301 problem with non www page

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 5
Joined: 17 Oct 2013, 10:08

301 problem with non www page

24 Oct 2013, 13:27

Hi

I thought I had everything working properly - however we discovered a problem with a non www page
Have tried all sorts of code but I cant see what is going wrong
Please can I have some help?

My htaccess on ISS6 with ISAP3...

RewriteEngine On
RewriteRule ^\.html$ http://www.MyNewDomain.co.uk/$ [R=301,L,NC]
RewriteRule ^index\.html$ http://www.MyNewDomain.co.uk/$ [R=301,L,NC]
RewriteRule ^pageabc\.html$ http://www.MyNewDomain.co.uk/pageabc/ [R=301,L,NC]
RewriteRule ^pageabcd\.html$ http://www.yNnewDomain.co.uk/pageabcd/ [R=30,L]
......and so on for another 100+ pages


All the 100+ individual pages are redirected perfectly on a page-to-page basis

http://MyOldDomaine.co.uk/ IS NOT WORKING

The redirection shows briefly as http://http://www.yNnewDomain.co.uk

and then the page revert back to the old one or gives an error in Internet explorer
"This page can't be displayed"

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: 301 problem with non www page

24 Oct 2013, 20:03

Hello,

a) I don't see the rule that addresses non-www URL here
b) I think we need to fix some syntax errors as well:

I do not see the reason why you'd need '?' at the end of the landing URLs
Code: Select all
RewriteRule ^\.html$ http://www.MyNewDomain.co.uk/$ [R=301,L,NC]
RewriteRule ^index\.html$ http://www.MyNewDomain.co.uk/$ [R=301,L,NC]


These URLs can be redirected using ONE rule. There's only one drawback - all .html file will be affected. If this is what you're trying to do, we can create this rule
Code: Select all
RewriteRule ^pageabc\.html$ http://www.MyNewDomain.co.uk/pageabc/ [R=301,L,NC]
RewriteRule ^pageabcd\.html$ http://www.yNnewDomain.co.uk/pageabcd/ [R=30,L]


Regards
Andrew

User avatar
Posts: 5
Joined: 17 Oct 2013, 10:08

Re: 301 problem with non www page

25 Oct 2013, 05:00

Hi Andrew
many thanks for the reply
I noticed a typo in my original question which may have misled you... so have re-created my example in the attachment...
Should I send the actual file as an attachment.?

We have created a new web site on a NEWDOMAIN, which contains the same pages (over100) in a different structure
and we are trying to 301 redirect all traffic from the OLDDOMAIN to the NEWDOMAIN so that all Google listings work on a page-to-page basis...

The old site is IIS6 new site apache..

The page to page is working for all the individual pages
And in Internet explorer the site root index.html and www. pages are all working perfectly.

However http://OLDDOMAIN.co.uk is not working.
The redirection shows briefly as http://http://www.NEWDOMAINE.co.uk
then reverts back to the OLDDOMAIN with an error in IE
And it displays the old page in Safari.

In addition www.OLDDOMAIN.index.html does not redirect in Safari

I have tried the following non www and it makes no difference
(attached a sample of the code I am using as I cant get enough url's into the post)

sample-htacess-for-question.txt
(542 Bytes) Downloaded 776 times


hope you can help

Best regards

Mark

User avatar
Posts: 5
Joined: 17 Oct 2013, 10:08

Re: 301 problem with non www page

25 Oct 2013, 05:41

Hi

me again

I added in the non-www code again

I think this is ok now -

It seems that Internet Explorer was gets stuck on what it last redirected?

www.OLDDOMAIN.co.uk now redirects in chrome, safari, firefox and Iphone.

It still gives me the double http://http:// in IE on my main computer, despite clearing the history.

However on a second computer it works fine in IE

Think I was making changes but not seeing them because of IE memory/cache/????

Thanks for helping

Best regards

Mark

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 10 guests