cgm225 Posted June 2, 2008 Share Posted June 2, 2008 Anytime someone visits my site, lets say example.com, with the address http://example.com, I want to "rewrite" that URL/redirect to http://www.example.com. Can I do this with Mod_Rewrite? How? Link to comment https://forums.phpfreaks.com/topic/108461-redirect-to-httpwww-from-http/ Share on other sites More sharing options...
lovesmith Posted June 3, 2008 Share Posted June 3, 2008 Do like this RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/(.*) http://fully.qualified.domain.name/$1 [L,R] Link to comment https://forums.phpfreaks.com/topic/108461-redirect-to-httpwww-from-http/#findComment-556279 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.