Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
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 /.* http://www.siteyouwanttoredirectto.com/ [R=301,L]
Reply With Quote
The Following User Says Thank You to showe1966 For This Useful Post:
falko (22nd September 2007)
Sponsored Links
Old 22nd September 2007, 13:30
falko falko is offline
Super Moderator
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts

This link might also be interesting: http://www.stevenhargrove.com/redirect-web-pages/
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Advice on how to setup Lintrack As A LAN Gateway And An OpenVPN Bridge eddiequek HOWTO-Related Questions 0 12th July 2007 11:38
Transaction error Perfect FC6 setup ACDII HOWTO-Related Questions 1 6th July 2007 15:56
Apache 301 redirect - file names with spaces hairydog2 General 2 8th January 2007 01:29
newbie ububtu 6.0.6 error PHP binary line 816 davidsky73 Installation/Configuration 8 17th September 2006 12:51
Website disabled with custom page and redirect. Herbert Feature Requests 3 7th August 2006 14:26

All times are GMT +2. The time now is 06:32.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.