翻译apache2重写规则
我有一个apache的.htaccess文件:翻译apache2重写规则,apache,nginx,rewrite,Apache,Nginx,Rewrite,我有一个apache的.htaccess文件: # we check if the .html version is here (caching) RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f # no, so we redirect to our front web controller RewriteRule ^(.*)$ ind
# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]
如何将其转换为.htaccess for nginx
我试着这样做:
location / {
rewrite ^/$ /index.html;
rewrite / /RewriteRule;
rewrite ^/(.*)$ /index.php last;
}
你认为正确吗
非常感谢 这样的事情不需要重写,只需要修改一下
try_files /index.html$is_args$args $uri.html$is_args$args $uri /index.php$is_args$args;