301 redirect - need help please..

YS*
Light Poster
10Jul2007,13:52   #1
YS*'s Avatar
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.
Go4Expert Founder
10Jul2007,16:57   #2
shabbir's Avatar
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]
YS*
Light Poster
10Jul2007,17:17   #3
YS*'s Avatar
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 ?
Go4Expert Founder
10Jul2007,18:38   #4
shabbir's Avatar
The inherent problem I see in your editing capabilities is you are changing all the \. to .
YS*
Light Poster
10Jul2007,19:00   #5
YS*'s Avatar
still not working..
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?atraf-f\.net/upload$ [NC]
RewriteRule ^(.*)$ http://www.atraf-f.net/$1 [R=301,L]
Go4Expert Founder
10Jul2007,19:43   #6
shabbir's Avatar
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.
YS*
Light Poster
10Jul2007,19:58   #7
YS*'s Avatar
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)
Go4Expert Founder
11Jul2007,09:01   #8
shabbir's Avatar
Does your web host support the .htaccess redirect? It may be the case that it does not.
YS*
Light Poster
11Jul2007,16:20   #9
YS*'s Avatar
off course.
i'm using redirects in my root folder..
Go4Expert Founder
11Jul2007,18:38   #10
shabbir's Avatar
But then you should always use the code I gave in the root folder only.