Forum Moderators: buckworks & webwork

Message Too Old, No Replies

www in url

www optional in address / url

         

randallxski

8:26 pm on Jun 21, 2004 (gmt 0)

10+ Year Member



I have a web site hosted on a shared server that I can get to via www.mysite.com or just mysite.com. Whatever I type in remains in the address line for the rest of the session. In a second site, the "www" is required; without it I get an "under construction" page.

How is a site configured to not require the prepended "www"? Is this a host file setting? Host header configuration?

If I wanted my logs to always show the www.mydomain.com address, what's the easiest way to force the www in the address?

Thanks.
>> Randall

PatrickDeese

9:23 pm on Jun 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if your web host supports htaccess, this will force the site to always use www.example.com


RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ [example.com...] [R=permanent]