.htaccess 排除目录
我在从重写规则中排除一些目录时遇到了一些麻烦。
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(cultivsearchenginesitemap|RSS)($|/) - [L]
RewriteRule ^(.*)$ http://www.niklashjelm.se/$1/ [L,R=301]
我想排除第三行上的目录,但它们不断收到尾部斜杠,并尝试将其放置在最后一行之前和之后。有什么想法吗?
I'm having some trouble excluding a few of my directories from a rewrite rule.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(cultivsearchenginesitemap|RSS)($|/) - [L]
RewriteRule ^(.*)$ http://www.niklashjelm.se/$1/ [L,R=301]
I want to exclude the directories on the third line but they keep getting the trailing slash, have tried placing it before and after the last line. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您说您不希望这两个目录发生重定向到
www.niklashjelm.se
的情况,那么第 3 行应该是条件(或对此进行一些调整):If you are saying that you don't want the redirect to
www.niklashjelm.se
to occur for these two directories then line 3 should be the cond (or some tweak to this):