View Single Post
Old 21st September 2007, 22:27
showe1966 showe1966 is offline
Join Date: Jan 2007
Location: naples italy
Posts: 46
Thanks: 4
Thanked 2 Times in 2 Posts
Default set up 301 redirect from old website to new website

I've just spent a very enjoyable 2 hours working out how to do the following.
What I needed to do was redirect all the traffic from my old website to my new website.

I am running ubuntu 7.04, apache 2.

Here is what you need to do:-

1. vi /etc/apache2/sites-enabled/000-default

2. Change the word "none" to "all in the following line:

NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All

3. Add the following code at the bottom of the file:

RewriteEngine ON
RewriteRule /.* [R=301,L]
Reply With Quote
Sponsored Links