Forum Moderators: phranque

Message Too Old, No Replies

301 returns 404 on directory only

all redirects take place

         

suzie250

3:55 pm on May 12, 2006 (gmt 0)

10+ Year Member



RewriteRule ^directory/(.*) http://www.example.com/$1 [R=301,L]
(this is a redirect from an old domain directory to a new domain of its own.)

I recently switched servers and the new server sends out a 404 when http:www.example.com/directory/ is requested. All other pages inside the directory are giving the correct 301.

I'm a little lost on this since the redirect does take place on all requests. Is this something I can correct or should I contact my new host?

Thanks,
Suzie

jdMorgan

4:02 pm on May 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried:

RewriteRule ^directory(/.*)$ http://www.example.com$1 [R=301,L]

What, if anything is in your server error log when you get the 404? (It should contain the actual filepath that the redirected URL resolved to, and this can be a strong clue as to what the real problem is.)

Jim

suzie250

4:28 pm on May 12, 2006 (gmt 0)

10+ Year Member



I was wrong that all redirects take place. (Sorry, JD. just when I think I have actually checked everything :>)

Thanks for your time. I have corrected this with
RewriteRule ^directory(.*)$ http://www.example.com$1 [R=301,L]