【发布时间】:2014-11-21 18:14:20
【问题描述】:
不转换。帮助
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css/common|robots\.txt|sitemap\.xml|test\.html|sitemap\.xml)
RewriteRule ^(.*)$ /index.php/$1 [L]
【问题讨论】:
标签: apache mod-rewrite nginx
不转换。帮助
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css/common|robots\.txt|sitemap\.xml|test\.html|sitemap\.xml)
RewriteRule ^(.*)$ /index.php/$1 [L]
【问题讨论】:
标签: apache mod-rewrite nginx
尝试提高你的提问技巧。很高兴看到您尝试了一些方法,甚至检查了您的原始配置,但没有通过复制粘贴(重复条目...)寻求帮助。
自动化工具最多可以尝试应用预先准备好的配方或 Apache 和 nginx 规则之间的 1 -> 1 关系。
他们将无法理解您想要做什么,并且很可能不会为您提供最佳/最干净/最精简/最推荐的解决方案。
例如这里,@Cheery 工具甚至忽略了条件... -_-'
尝试以下方法:
location /index.php {
}
location /images {
}
location /css/common {
}
location /robots.txt {
}
location /sitemap.xml {
}
location /test.html {
}
location / {
# Use 301 instead of 302 for permanent redirect
return 302 $scheme://$host/index.php$request_uri;
}
【讨论】: