本地主机和远程主机如何将根重定向到子目录?htaccess如何将两个主机重定向到子目录
本地主机:domain.localhost
远程主机:domain.com
子目录:子目录
domain.localhost -> domain.localhost/subdir/<br>
domain.localhost/ -> domain.localhost/subdir/<br>
domain.com-> domain.com/subdir/<br>
www.domain.com -> www.domain.com/subdir/<br>
Options +FollowSymLinks
DirectoryIndex questions.php
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.localhost$
RewriteRule ^(.*)$ http://domain\.localhost/subdir/$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) http://www.domain.com/subdir/ [R=301,L]
我已经尝试了所有的解决方案,但不幸的是没有按预期工作。谢谢你们所有的答案。 – Codex73 2012-03-22 17:49:06