【发布时间】:2012-01-12 17:13:59
【问题描述】:
我有这个文件 .htaccess 用于 apache:
# 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 用于 nginx ?
我试过这个:
location / {
rewrite ^/$ /index.html;
rewrite / /RewriteRule;
rewrite ^/(.*)$ /index.php last;
}
你觉得对吗?
非常感谢!
【问题讨论】: