Forum Moderators: mack

Message Too Old, No Replies

htaccess 301 redirect question

Can't get the code to work

         

Iczer

1:40 pm on May 2, 2006 (gmt 0)

10+ Year Member


I can't seem to get a 301 redirect to work from my htaccess file. I want to redirect within my site. I have used the following code.

Redirect 301 mysite/dirctory/subdirectory/mypage.html http://www.mysite/directory/index.php

Any help would be appriciated.

jatar_k

2:41 pm on May 2, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



for reference
[httpd.apache.org...]

your first path should probably be a fully qualified url or at least a root relative path (have a starting slash). I would try a fully qualified url first.

I have also never used the code I always use permanent

Redirect permanent http://www.example.com/mysite/dirctory/subdirectory/mypage.html http://www.example.com/directory/index.php

or with a starting slash

Redirect permanent /mysite/dirctory/subdirectory/mypage.html http://www.example.com/directory/index.php

jdMorgan

2:56 pm on May 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Option #2 is correct:

Redirect permanent /mysite/directory/subdirectory/mypage.html http://www.example.com/directory/index.php

Jim

jatar_k

10:08 pm on May 2, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



thankfully Jim is smarter than me ;)