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
Prev Previous Post   Next Post Next
  #1  
Old 21st September 2007, 21:27
showe1966 showe1966 is offline
Member
 
Join Date: Jan 2007
Location: naples italy
Posts: 45
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>
<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
 

Bookmarks

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 10:38
Transaction error Perfect FC6 setup ACDII HOWTO-Related Questions 1 6th July 2007 14:56
Apache 301 redirect - file names with spaces hairydog2 General 2 8th January 2007 00:29
newbie ububtu 6.0.6 error PHP binary line 816 davidsky73 Installation/Configuration 8 17th September 2006 11:51
Website disabled with custom page and redirect. Herbert Feature Requests 3 7th August 2006 13:26


All times are GMT +2. The time now is 21:58.


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