Solved

Apache Redirect

Posted on 2007-03-26
1
175 Views
Last Modified: 2010-03-04
I want to redirect anything from http://www.oldsite.com/ANYTHING to home page for new site of http://www.newsite.com/

What are the Rewrite commands?

Where do I put it in the httpd.conf file. Do I still need the virtual host set up for oldsite.com?
0
Comment
Question by:BrentNJ
1 Comment
 
LVL 21

Accepted Solution

by:
Julian Matz earned 125 total points
ID: 18797005
Hi!

Here is the syntax (mod_rewrite):

RewriteRule ^/(.*)$ http://www.newsite.com/$1 [R=301,L]

You can place this inside the appropriate <directory> directives. I'm pretty sure it also works inside the <VirtualHost> directive ...

For example:

<Directory "/var/www/html">
 RewriteEngine On
 RewriteRule ^/(.*)$ http://www.newsite.com/$1 [R=301,L]
</Directory>

Yes, you would still need to keep the vhost ...
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now