Friday, January 28, 2011

.htaccess redirect doens't work correctly

Hi,

I'm using a .htaccess to get all documents from an old site to the new one. The old site doesn't support PHP or mod_rewrite. I tried the following code:

Redirect 301 / http://www.new.com/archive/

I requested " http://www.new.com/archive/index.html" Which resulted into

http://www.new.com/archive/old.com/olddir/&&&/&&&/users/4/web/00/00/24/04/44/&&&/1/&&&/0/&&&/&&&/&&&/users/4/web/00/00/24/04/44/&&&/1/&&&/0/&&&/index.html

Is this possible to solve?

  • Kevin -

    At first glance, it looks like something within your application is doing quite a few redirects. The simple Redirect statement in your .htaccess shouldn't be creating the very long URL that you pasted above.

    It may help you debug the issue if you use curl to test it:

    $ curl -I olddomain.com | grep ^Location
    Location: http://newdomain.com/archive/olddomain.com/
    

    From there, just curl the URL that is returned and see where you're redirected then. Take the next URL and curl it as well. Keep going until you are able to debug the source of those redirects.

0 comments:

Post a Comment