将 301 特定文件夹重定向回根域:如何在 .Htaccess 中设置?
亲爱的朋友们,如何在共享主机上的 .Htaccess 中设置正确的 APACHE 规则以使此条件和规则正常工作:
RewriteCond ...
RewriteRule ...
Where...
Condition = 如果浏览器 URL 包含任何等于(one|two|third)
的目录是禁止目录,那么...
规则=不要加载任何页面,而是:301到相对根目录< code>/ ...这样可以有效地加载主域名,无论该域名是什么。所以:再一次:我不想使用硬编码的绝对域名,只是相对根(或者删除与进入根相同的整个相对网址,对吧?)
非常感谢您的建议。
Dear folks, How to setup a proper APACHE rule in .Htaccess on shared hosting to get this Condition and Rule working:
RewriteCond ...
RewriteRule ...
Where...
Condition = If the browser url contains any directory equal to (one|two|three)
which are forbidden directories, then...
Rule = do not load any pages there, instead: 301 to the relative root /
... that way loading effectively the main domain name, whatever that domain may be. So: once again: I don't want to to use hard coded absolute domain name, just relative root (or erase the entire relative url that would be same as going to the root right?)
Thank you very much for your suggestion.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
类似于……的事情
应该可以做到。
Something along the lines of...
...should do it.