Status
Not open for further replies.

figment

New Member
Hi Guys, i want to redirect ALL links from an old website to ONE single page (Root) on a new domain.

The code I have is:

Redirect 301 / http://www.domain.com/

This tries to match the original directory path on the new domain eg:
www.blah.com/about will redirect to www.domain.com/about .
This is what I do not want.

Instead i want:
www.blah.com/about to point to www.domain.com/

Can you help?

Thanks,
Alan
 

mneylon

Administrator
Staff member
I can probably ask one of our guys on Tuesday - he's a bit of a whiz with regular expressions + mod_rewrite ..
 

figment

New Member
Thanks for all the help Guys.
The solution that worked was:

RewriteEngine On
RewriteRule .* http://www.domain.com/ [R=301,L]

PHP.Allstar for some reason removing the brackets in your solution made the difference.

Alan
 

methodshop

New Member
.htaccess wildcard redirect example

i own multiple domains for my site MethodShop, including methodshop.com, methodshop.net, etc.. When doing maintenance, i'll divert traffic between the different sites so my users don't have their experience interrupted. below is the htaccess wildcard script i use. it takes whatever URL the user attempts to access and mirrors that link on another domain.

for example,
http://www.methodshop.net/games/play/bubblewrap/index.shtml

would redirect to
http://www.methodshop.com/games/play/bubblewrap/index.shtml

here's the script....

#htaccess script for methodshop.net
#rewrites all methodshop.net URLs to methodshop.com

RewriteEngine on
RewriteRule (.*)$ http://www.methodshop.com\/$1 [R=301,L]
 
Status
Not open for further replies.
Top