2010-07-26 92 views

回答

1

尝试

Options +FollowSymlinks 
RewriteEngine on 
rewritecond %{http_host} ^site.com [nc] 
rewriterule ^(.*)$ http://www.site.com/$1 [r=301,nc] 
+0

这似乎是主站点的重定向,而不是子网站,我的目标是重定向我的子网站的URL。例如:site.com/fr/etc/etc应重定向到www.site.com/fr/etc/etc – level09 2010-08-15 22:23:44

+0

只需为每个域添加新规则即可。如果你正在运行任何体面的多站点,试试Aegir,一个网站管理员,它会为你管理所有这些。 在我看来www。是多余的,例如,stackoverflow没有它。 – Keyo 2010-08-15 23:14:54

0
RedirectPermanent /ru http://www.site.com/ru 

可能是一个更好的选择重写规则。

0

如果检查.htaccess文件,你可以在85-90线看(Drupal的7.x版):

# To redirect all users to access the site WITH the 'www.' prefix, 
# (http://example.com/... will be redirected to http://www.example.com/...) 
# uncomment the following: 
# RewriteCond %{HTTP_HOST} . 
# RewriteCond %{HTTP_HOST} !^www\. [NC] 
# RewriteRule^http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

如果你去掉这一行,你可能会得到解决您的问题。

相关问题