Nginx location fix: redirection to index.html

I am running nginx v 1.0.4, and we are trying to do the following:

location ~ ^/${ 
rewrite ^.*$ /index.html last;
}

Basically: if the user reaches the default domain http://www.foo.com or http://www .foo.com/ redirects it to http://www.foo.com/index.html

When I add it to my conf file, I get the following:
Start nginx in /etc/nginx/myconf.conf: nginx: [emerg] unknown command “”

Thanks in advance.

You can use the rewrite function without a location

rewrite ^/$ /index.html last;

Or permanent redirection

rewrite ^/$ /index.html permanent;

Rewrite with parameters, for example http://www.foo.com/?param=value –> http://www.foo.com/index.html?param=value

rewrite ^/ (\?.*)?$ /index.html$1 permanent;

I am running nginx v 1.0.4, and we are trying to do the following:

< /p>

location ~ ^/${
rewrite ^.*$/index.html last;
}

Basically: if The user reaches the default domain http://www.foo.com or http://www.foo.com/ and redirects them to http://www.foo.com/index.html

When I add it to my conf file, I get the following:
in Start nginx in /etc/nginx/myconf.conf: nginx: [emerg] unknown command “”

Thanks in advance.

You You can use the rewrite function without a location

rewrite ^/$ /index.html last;

Or permanent redirection< /p>

rewrite ^/$ /index.html permanent;

Rewrite with parameters, such as http://www.foo.com/?param=value –> Http://www.foo.com/index.html?param=value

rewrite ^/(\?.*)?$ /index.html$1 permanent ;

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4629 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.