【发布时间】:2014-10-20 21:21:20
【问题描述】:
我试图将子目录重定向到隐藏 URL 的外部 URL。我已经使用 htaccess 将域重定向到子目录,并且我想保持此重定向显示“博客”子目录 URL。
我的代码是这样的:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteRule ^(/)?$ blog [L]
RewriteCond %{HTTP_HOST} ^(www\.)?mysite\.com$ [NC]
RewriteRule ^subdirectory/?$ http://othersite.com/subdirectory [L,R=301,NC]
我需要更改什么以仅隐藏第二次重定向的 URL?
谢谢!
【问题讨论】:
标签: .htaccess mod-rewrite redirect