Forum Moderators: phranque

Message Too Old, No Replies

Original HTML pages for 301 redirect?

         

TadM

6:58 pm on Dec 13, 2005 (gmt 0)

10+ Year Member



And the novice asks....
I have an old site that I am redirecting to a new site. I also want to use 301 redirects for the old pages to the new site and similiar pages. For a 301 redirect to work do the actual (old) HTML pages need to be present at the old site?

Also, for clarification, I would use:
redirect 301 /folder/old.htm htt://www.newsite.com/new.htm

In the above line, if "folder" is actually just the public_html folder would I just write the line as:

redirect 301 /old.htm htt://www.newsite.com/new.htm

or would it read:

redirect 301 /public_html/old.htm htt://www.newsite.com/new.htm

Thanks for any and all advice.

jdMorgan

9:28 pm on Dec 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



TadM,

Welcome to WebmasterWorld!

> For a 301 redirect to work do the actual (old) HTML pages need to be present at the old site?

No, the server will process the redirect directive and return the 301 response before checking whether the files exist.


In the scenario you describe,


Redirect 301 /old.htm http://www.example.com/new.htm

is correct.


Note that the Redirect directive uses prefixs-matching; Anything that *starts with* the local URL_path given in the left side argument will be redirected to the URL given as the right side argument, with any remainder of the requested URL appended.

For example, using the directive above, /old.html will be redirected to http://www.example.com/new.html as well.

So, it is possible to redirect all URLs to the new domain by using

Redirect 301 / http://www.example.com/

If you need more-sophisticated URL-matching, see RedirectMatch [httpd.apache.org].

Jim

TadM

10:27 pm on Dec 13, 2005 (gmt 0)

10+ Year Member



Thanks Jim.

Interestingly I checked with my host provider's(iPowerweb) tech support and they stated the old HTML files DO need to be present. I thought this was strange and doesn't really make a lot od sense as pages changes, come and go.

Thanks again.

Tad

>Welcome to WebmasterWorld!

> For a 301 redirect to work do the actual (old) HTML pages need to be present at the old site?

>No, the server will process the redirect directive and return the 301 response before checking whether the files exist.