Link to home
Start Free TrialLog in
Avatar of Geesu
Geesu

asked on

How to re-route traffic? mod_rewrite I think ?

Basically I moved this URL:

http://wc3mods.net/war3ft/

to:

http://war3ft.com/

Is there a way to do a mod_rewrite or something so that people that try to access ANY file that was in wc3mods.net/war3ft/ will be like auto-redirected to war3ft.com?  I'd rather not have to like duplicate the site or make a bunch of PHp header( "Location: blah.php" ); scripts.

Thanks,
Josh
Avatar of giltjr
giltjr
Flag of United States of America image

Why not just create a single html document that presents a page that says "this has been moved to ..... please update your book marks" then after 5 to 10 seconds redirect them?

In the HTML header you would code:

<META HTTP-EQUIV="REFRESH" CONTENT="10;URL=http://war3ft.com">

Where "10" is the number of seconds the page is displayed until it is refreshed and redirected to war3ft.com.
ASKER CERTIFIED SOLUTION
Avatar of giltjr
giltjr
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Geesu
Geesu

ASKER

Yea i basically want them to be "redirected" to the war3ft.com page
Are these two sites on the same Apache server?
Avatar of Geesu

ASKER

yes they are
What I would suggest then is that you leave the files where they are located for the URL:

     http://wc3mods.net/war3ft/

Then setup http://war3ft.com so that it is a virual host and the document route is the document route for wc3mods.net plust /war3ft.

That is if w3cmods.net has a documentroot of /var/www/htdocs/ that you setup a virtual host for war3ft.com and set its documentroot to /var/www/htdocs/war3ft.  This way you have two "URL" that are using the same files.  The people that are used to do http://wc3mods.net/war3ft can still do that and everbody else can do http://war3ft.com.  You could do something like:

     <VirtualHost *>
        DocumentRoot "/var/www/htdocs/war3ft"
        ServerName war3ft.com
        ServerAlias www.war3ft.com
     </VirtualHost>

You don't need the ServierAlias, but if you want to have somebody enter http://www.war3ft.com  this will allow this one VirtualHost to be used for both http://www.war3ftp.com and http://war3ft.com.
Avatar of Geesu

ASKER

I don't want to, I want to do a mod_rewrite if possible...  I don't have access to the apache.conf or whatever and don't want to go that route
What do you have access to then?   mod-rewrite is either in one of the .conf file used by Apache or .htaccess, however .htaccess has to be enabled for you directories.  Normally .htaccess is not enabed as it causes a lot of overhead on the server.
Avatar of Geesu

ASKER

i have .htaccess enabled...
You can try:

RewriteEngine on
RewriteRule   ^/war3ft/$  http://war3ft.com/  [R]

Not 100% sure about this.

However, using this means that nobody may realize that http://wc3mods.net/war3ft/ has moved and may still continue to go there.