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? Quote 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] Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.