我在regexps上很坏,但在服务器上--我最坏的是。所以任何帮助都是有用的。
在nginx-config中有这样的
location / {
rewrite ^(.*[^/])$ $1/ permanent;
try_files $uri $uri/ /index.php?$args;
}
.htacces需要同等的东西。泰。
发布于 2014-06-19 12:05:01
它们应该是非常相似的。
<IfModule mod_rewrite.c>
RewriteEngine On
# Your web directory root
RewriteBase /
#Make sure it's not a specific file or directory that they're trying to reach
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*[^/])$ index.php?args=$1 [NC, L]
</IfModule>
这将:
NC、L标志告诉规则不区分大小写,并分别告诉Apache这是最后一条重定向规则。
我不得不承认,我不知道你的Regex在测试什么。您介意解释一下您想要建立的URL方案吗?我应该能帮你正确地制定Regex。
https://stackoverflow.com/questions/24304338
复制相似问题