Related / Friend Blogs
Top Poster
#1 ramon fincken 93
#2 Site admin 2
#3 Jan 0
[solution] Adding "www." in front of your domain using htaccess rewrite rules ( modrewrite )



Rating : 4.3 / 5

 
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding
View previous topic :: View next topic  
Author Message
ramon fincken
Site's programmer


Joined: 03 Aug 2007
Posts: 93
Location: Amsterdam, the Netherlands/Europe

PostPosted: Mon Jul 07, 2008 8:01 pm    Post subject: [solution] Adding "www." in front of your domain using htaccess rewrite rules ( modrewrite ) Reply with quote

Allright, if you require to have a "www." in front of your domain name at all times add this to your htaccess file:


Code:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.ramonfincken\.com$ [NC]
RewriteRule ^(.*)$ http://www.ramonfincken.com/$1 [R=301,L]



It completely rewrites ( click to see in action ! )
http://ramonfincken.com to http://www.ramonfincken.com
and also
http://ramonfincken.com/?foo=bar to http://www.ramonfincken.com/?foo=bar

Read on:
http://www.askapache.com/htaccess/mod_r...write-hint
Back to top
View user's profile Send private message Visit poster's website
Google adsense
Advertisement





PostPosted: Mon Jul 07, 2008 8:01 pm    Post subject: [solution] Adding "www." in front of your domain using htaccess rewrite rules ( modrewrite )

Advertisement
Back to top
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum
General forums
The world of freelance
Programming
Other projects
Poll
I love gifts

Yes goodies and presents! [1]
No but I love polls ! [0]

Technorati Profile