?
Solved

How to re-route traffic? mod_rewrite I think ?

Posted on 2006-07-10
10
Medium Priority
?
251 Views
Last Modified: 2010-03-04
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
0
Comment
Question by:Geesu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 57

Expert Comment

by:giltjr
ID: 17077355
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.
0
 
LVL 57

Accepted Solution

by:
giltjr earned 2000 total points
ID: 17077436
Of couse I just realized that it does not help if they have bookmarked anything other than the default HTML page.
Are the page/file names within the web site EXACLY the same?  That is if you have:

   http://wc3mods.net/war3ft/page01.html

do you have:

   http://ware3ft.com/page01.html

If so, then mod_rewrite will work.  Are these on the same Apache server, or two different servers?  If on different servers, then you might be able to do something like:

    RewriteEngine on
    RewriteRule   ^/war3ftp  http://war3ft.com/$1  [R,L]

If they are on the same server, there are things you can do with virtual hosting.  Do you want the users to stop going to:

   http://wc3mods.net/war3ft

0
 

Author Comment

by:Geesu
ID: 17077545
Yea i basically want them to be "redirected" to the war3ft.com page
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 57

Expert Comment

by:giltjr
ID: 17078559
Are these two sites on the same Apache server?
0
 

Author Comment

by:Geesu
ID: 17078617
yes they are
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17079000
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.
0
 

Author Comment

by:Geesu
ID: 17081803
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
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17084030
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.
0
 

Author Comment

by:Geesu
ID: 17084035
i have .htaccess enabled...
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17084807
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.

0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question