www.www.
4 posts
• Page 1 of 1
www.www.
Hi
Used the "Redirecting non-www version to www" for our site from examples on our site, but have noticed that a few urls are starting to get indexed in google which are just plain strange.
http://www.www. etc..
We use the following:
Now I know we can do rel canonical on our pages, but really dont feel this should be needed.
Anything we can do to fix this?
We just want <domainname>.com to redirect to http://www. and leave it at that.
Anyone?
Used the "Redirecting non-www version to www" for our site from examples on our site, but have noticed that a few urls are starting to get indexed in google which are just plain strange.
http://www.www. etc..
We use the following:
- Code: Select all
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
Now I know we can do rel canonical on our pages, but really dont feel this should be needed.
Anything we can do to fix this?
We just want <domainname>.com to redirect to http://www. and leave it at that.
Anyone?
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: www.www.
Well, this rule has been verified hundreds of times, so we can simply hardcode it a little for you:
But I don't think it's the rule, there could be other settings elsewhere that do the same.
Regards
Andrew
- Code: Select all
RewriteCond %{HTTP:Host} ^(yourDomain\.com)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http://www.%1%2 [NC,R=301,L]
But I don't think it's the rule, there could be other settings elsewhere that do the same.
Regards
Andrew
Re: www.www.
Hi Andrew
And thanks for that.
After your comments about other settings I decided to try and completely remove all conditions and the result is the same.
Very very strange. Something somewhere is doing the redirection and only seems to happen when I use a masterpage.
Going to have to dig deeper.
Regards,
Soeren
And thanks for that.
After your comments about other settings I decided to try and completely remove all conditions and the result is the same.
Very very strange. Something somewhere is doing the redirection and only seems to happen when I use a masterpage.
Going to have to dig deeper.
Regards,
Soeren
Re: www.www.
HeliconAndrew wrote:Well, this rule has been verified hundreds of times, so we can simply hardcode it a little for you:
- Code: Select all
RewriteCond %{HTTP:Host} ^(yourDomain\.com)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http://www.%1%2 [NC,R=301,L]
But I don't think it's the rule, there could be other settings elsewhere that do the same.
Regards
Andrew
I have a site where they want to redirect the domain.co.uk to domain.com, as well as sweeping up the non-www variants.
I went to the Apache docs and it said to use a Redirect directive within VirtualHost tags, but ISAPI_Rewrite says it's invalid.
Is a variant of the above the way to achieve this?
The alternative (which seems a little kludgy) is to set up another website in IIS, point the .co.uk and non-www bindings to it and use a 301 redirect in IIS.
Thoughts?
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 10 guests