【发布时间】:2013-08-10 03:08:35
【问题描述】:
我需要修改 .htaccess 文件,以便我可以覆盖我的域。 首先我告诉你,我对 .htaccess 文件一无所知。 而且那个 .htaccess 文件里已经有很多东西了。
我想要的是重定向我的
www.one-domain.com
到
www.second-domain.com/abc
我不想改变其他任何事情。只有 one-domain.com 开始显示 second-domain.com/abc 的内容
两个站点之间的域都是wordpress。
one-domain.com 内容位于 root/
second-domain.com 内容位于root/direcoty
下面是我已有的 .htaccess 文件的内容。
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
【问题讨论】:
-
也只是
www.onedomain.com到www.second-domain.com/abc或www.onedomain.com/foo到www.second-domain.com/abc/foo?这将是一个外部重定向,并且还会更改浏览器中的 URL,可以吗? -
仅 www.onedomain.com 到 www.second-domain.com/abc。但是我不想要外部重定向,但这仍然可以,并且对我有用。