我希望我的apache .htaccess能够使用nginx。
我有这个.htaccess文件/代码
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>我希望你能帮我:)
发布于 2014-11-26 23:07:33
它将在nginx中转换成这样的东西:
server {
server www.domain.com;
index index.php;
location / {
try_files $uri $uri/ /index.php;
}
location ~\.php$ {
...
}
}发布于 2014-11-26 23:16:30
如果您想将"index.php“保存在url中,我会这样做。
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
try_files $uri @redirect;
...
}
location @redirect {
return 301 $1/index.php;
}https://stackoverflow.com/questions/27157802
复制相似问题