Guest Posted March 14, 2007 Share Posted March 14, 2007 I need my server to add www. to the begining of my domains. For example if you go to example.com i would want it to change to www.example.com how can i do that? Link to comment https://forums.phpfreaks.com/topic/42749-solved-www/ Share on other sites More sharing options...
WebGeek182 Posted March 15, 2007 Share Posted March 15, 2007 Very easy my friend. Simple add this to the beginning of your .htaccess: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.example\.com RewriteRule ^/(.*) http://www.example.com/$1 [R=301,L] If you need more help, please let me know. Also you may want to check out this .htaccess reference. Link to comment https://forums.phpfreaks.com/topic/42749-solved-www/#findComment-207624 Share on other sites More sharing options...
Guest Posted March 15, 2007 Share Posted March 15, 2007 oh thak you so much. Can i put it in a directory above all the domains and have it work for all of them somehow? Link to comment https://forums.phpfreaks.com/topic/42749-solved-www/#findComment-207644 Share on other sites More sharing options...
Guest Posted March 15, 2007 Share Posted March 15, 2007 I cant figure a way for it to work for anything below it. Is there a way? Link to comment https://forums.phpfreaks.com/topic/42749-solved-www/#findComment-207747 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.