开发者

Drupal Multisite in subfolders, www redirection in htaccess

I'm using a multisite setup in subfolders, everything works fine except the non-www to www redirection.

I got it working with no issue开发者_如何转开发s for the main domain, but I cant get it to work for the other sites: for example , I want this redirection :

site.com/ru > www.site.com/ru


Try

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


If you check .htaccess file you may see on 85-90 line (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]

And if you uncomment this lines you may get solutions for your problem.


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

might be a better alternative to Rewrite rules.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜