0

I have found loads of examples of rewrite rules for non www to www but i am just looking to check what the practice is for allowing www. redirects when subdomain already exists...

So let's say i want to enable people to type:

http://www.shop.mysite.com

and have them redirected to

http://shop.mysite.com

Would the sequence below allow this?

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.shop\.mysite\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://shop.mysite.co.uk/$1 [L,R=301]

Yes i know this seems kind of silly but people in my organisation are freaking out about the possibility of people typing out our full subdomain url and including a www. Looking to try and allay their fears.

Sorry for the noob nature of the question.

Kind regards,

C

4

1 回答 1

0

当然,它有效!您可以在http://htaccess.madewithlove.be/上查看您的 htaccess

于 2014-10-27T15:15:30.297 回答