Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Apache2 redirect
PostPosted: Fri Nov 20, 2009 11:50 pm 
Offline

Joined: Fri Nov 20, 2009 11:47 pm
Posts: 1
Hi there,

I'm trying to redirect http://homepage.com to http://www.homepage.com

and also http://otherpage.com to http://www.homepage.com

I know how to do this with NGINX with a simple rewrite. Could someone please help me with apache2? I know it should be super easy.

Thanks!


Top
   
 Post subject:
PostPosted: Sat Nov 21, 2009 2:44 am 
Offline
Senior Member

Joined: Tue Apr 27, 2004 5:10 pm
Posts: 212
There are a bunch of ways to do this. Usually what I would do is:

Create two separate vhosts - one for the www.homepage.com and one for homepage.com. Set up the www.homepage.com vhost like you normally would. Then the homepage.com vhost just needs to look like this:

Code:
<VirtualHost *:80>
    ServerName homepage.com
    Redirect / http://www.homepage.com/
</VirtualHost>


Top
   
 Post subject:
PostPosted: Sat Nov 21, 2009 4:39 pm 
Offline
Junior Member
User avatar

Joined: Sun Oct 02, 2005 11:54 am
Posts: 43
Website: http://www.garyscott.net
Location: Goleta, CA
Here is the Documentation on the Redirect as mentioned above

http://httpd.apache.org/docs/2.2/mod/mod_alias.html


Top
   
 Post subject:
PostPosted: Sat Nov 21, 2009 6:59 pm 
Offline
Senior Member

Joined: Sun Aug 02, 2009 1:32 pm
Posts: 222
Website: https://www.barkerjr.net
Location: Connecticut, USA
If you specify "Permanent", search engines are supposed to replace the URL they requested with the destination one.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group