Forum Moderators: phranque

Message Too Old, No Replies

301 old .asp page to new .html

with or without the forward slash on the later?

         

Lorel

5:31 pm on Nov 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I redesigned a site and set up a rule in htaccess to redirect old .asp pages to new.html pages using the following format (with "RewriteEngine on" already in the htaccess file):

RewriteRule ^oldpage\.asp$ newpage.html

After 2 months Google still has all the old .asp pages listed and with supplemental results. All new pages are listed and they are fine. When I click on the old .asp links in Google it brings up the new page with the old .asp extension on it.

I did some reading and find confusing data re putting a forward slash before the new page URL, i.e.,

RewriteRule ^oldpage\.asp$ /newpage.html

and also I assume, being as this was a permanent move I should have added the 301 on the end, i.e., I assume I should have listed the rule as:

RewriteRule ^oldpage\.asp$ /newpage.html [R=301]

Can someone tell me if this is correct please?

jdMorgan

5:37 pm on Nov 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The correct syntax for ane external redirect (required to 'fix' a search engine listing) is:

RewriteRule ^oldpage\.asp$ http://www.example.com/newpage.html [R=301,L]

The syntax you used simply substitutes the *file* newpage.html whenever the URL oldpage.asp is requested, and does not inform the client (browser or robot). While this is a very useful function of mod_rewrite, it's not what you wanted.

Jim

Lorel

6:56 pm on Nov 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thanks JD :)