MyBB Community Forums

Full Version: How do you force the "www" in the URL?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Unfortunately I can't search for this answer because the forums are telling me I need 4 letters minimum. Blush

I want to force the www to be written into the URL address. I don't know if this is controlled in the admin or with .htaccess, but I want the "www" to be present in the address bar at all times. Currently, my forums will work if I go to the example.com or www.example.com versions of the domain (which is a not-so-good thing). When somebody goes to the example.com version, I want it rewritten to www.example.com.
Yeah you need to use htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
You forgot the first "R". Corrected code is below:
(2011-05-23, 10:27 PM)faviouz Wrote: [ -> ]Yeah you need to use htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

Thanks, folks. That did it. Smile