301 redirect - need help please..

YS*'s Avatar
YS*
Light Poster
need to 301 redirect like that -
www.domain.com/dir/index.php

will be redirected to

www.anotherdomain.com/index.php

and all the other pages as well,
for example
www.domain.com/dir/forumdisplay.php?f=92

will 301 redircet to
www.anotherdomain.com/forumdisplay.php?f=92
and all the posts and threads as well..
vBulletin board, I basically want that a user that will try to teach a page in the board on the dir',
will be redirected to the same page in the new domain (301)

thanks a lot for the help.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Search Engine Optimization FAQ's has your answer and I will quote it here.

Quote:
Originally Posted by SEO Faq's
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.new-domain.com/$1 [R=301,L]
0
YS*'s Avatar
YS*
Light Poster
it doesn't work..

PHP Code:
RewriteEngine On
RewriteCond 
%{HTTP_HOST} ^(www\.)?atraf-f.net\.net/upload$ [NC]
RewriteRule ^(.*)$ http://www.atraf-f.net/$1 [R=301,L] 
i've edited it, i need it to redirect all the pages from in a directory to an other domain name,
here i'vw just tested the code so i've used the same domain, what to do ?
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
The inherent problem I see in your editing capabilities is you are changing all the \. to .
0
YS*'s Avatar
YS*
Light Poster
still not working..
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?atraf-f\.net/upload$ [NC]
RewriteRule ^(.*)$ http://www.atraf-f.net/$1 [R=301,L]
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I am not sure why its not working but when I visited the forum I saw you are setting up the new forum and so why not just move the files from the upload directory to the parent one. Unnecessary redirect would not help.
0
YS*'s Avatar
YS*
Light Poster
i have another board
www.atraf-f.net/or
i bought a new domain for it - www.israelbody.org
and i want all the users to be redirected to the new domain (+ all the google pages)
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Does your web host support the .htaccess redirect? It may be the case that it does not.
0
YS*'s Avatar
YS*
Light Poster
off course.
i'm using redirects in my root folder..
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
But then you should always use the code I gave in the root folder only.