Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Apache rewrite question
PostPosted: Tue Apr 20, 2004 12:23 am 
Offline
Senior Newbie

Joined: Tue Apr 20, 2004 12:20 am
Posts: 5
Hello,

Does anyone have a snippet of an apache config file that demonstrates a simple rewrite rule for prepending the "www" portion to the domain name? I know the basics of apache configuration but the rewrite stuff (especially the regular expresions!) is very confusing to me.

I'm just trying to get mydomain.com to always load up in a browser as www.mydomain.com.

Thanks much,
Jeff


Top
   
 Post subject:
PostPosted: Tue Apr 20, 2004 12:47 pm 
Offline
Newbie

Joined: Mon Mar 29, 2004 11:22 am
Posts: 3
Hi,
you don't need rewrite for that. Rewrite is not recommended for security reasons. Do this in your apache config:

# yourdomain.com - redirect to www.yourdomain.com
<VirtualHost x.x.x.x>
ServerName yourdomain.com
ServerAdmin admin@yourdomain.com
Redirect / http://www.yourdomain.com/
</VirtualHost>


Top
   
 Post subject:
PostPosted: Tue Apr 20, 2004 10:19 pm 
Offline
Senior Newbie

Joined: Tue Apr 20, 2004 12:20 am
Posts: 5
This is perfect!

Thanks much!


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


Who is online

Users browsing this forum: No registered users and 4 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