.htaccess 重定向到特定网址的子目录
我需要一些重定向指导:
我在一台主机上安装了两个 WordPress - 每个安装在一个单独的子目录中。
我能够让控制面板为每个域设置重定向,例如:
www.domain1.com
重定向到www.domain1.com/d-one/< /code>
和
www.domain2.com
重定向到www.domain2.com/d-two/
效果很好 - 我不太担心路径包含子目录(我想我无法隐藏它)。
但是,为了方便访问者,我想设置重定向,例如:
www.domain1.com/contact
重定向到www.domain1.com/d-one/contact
和
www.domain2.com/contact
重定向到www.domain2.com/d-two/contact
...重定向知道哪个域是哪个域。
I require some guidance with redirects please:
I have two WordPress installations on one hosting - one each in a separate sub-directory.
I was able to get the control panel to set up redirects for each domain, so that - for example:
www.domain1.com
redirected towww.domain1.com/d-one/
and
www.domain2.com
redirected towww.domain2.com/d-two/
Which works fine - I'm not too bothered that the path contains a subdirectory (I assume I can't hide it).
However, for convenience of the visitors, I would like to set up redirects so that for example:
www.domain1.com/contact
redirects towww.domain1.com/d-one/contact
and
www.domain2.com/contact
redirects towww.domain2.com/d-two/contact
... the redirect knows which domain is which.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看到没有人急于提供帮助:(,我在其他地方做了一些自己的挖掘(如果我不这么忙的话,我可能应该早点做一些事情)......
在用尽了所有关于此的线程之后网站,我找到了这个网站:
http://corz.org/serv/tricks/htaccess2.php< /a>
将我与此解决方案放在“一个根中的多个域”下:
它还帮助我隐藏了不需要的子目录 d-one 和 d-two
!
Seeing as no-one was in any hurry to help :( , I did my own bit of digging elsewhere (something I probably should have done earlier if I weren't in such a flap)...
After exhausting all the threads on this site, I found this site:
http://corz.org/serv/tricks/htaccess2.php
which sorted me right up with this solution under "multiple domains in one root":
and it also helped me to hide the unwanted subdirectories d-one and d-two.
Loverly jubbly!