PDA

View Full Version : how to ensure that 'www' is always included in the url?


ABLady
Fri 4th Mar '05, 6:40pm
on my server, when I type:
http://www.mysite.domain/forums/ (http://www.mysite.domain/forums/)

the www remains in the url when the page loads; However, if I leave the '/' off the end of url like so:
http://www.mysite.domain/forums

the 'www' part gets dropped in the page that loads... like so:
http://mysite.domain/forums/

My question:
How do I set my server so that the 'www' never gets dropped?

sebe
Fri 4th Mar '05, 9:09pm
try setting UseCanonicalName in httpd.conf to Off.. eg,

UseCanonicalName Off

also, if you always want www. in the url you can use rewrite to change mydomain.com to www.mydomain.com

you can add this to htaccess file or httpd

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R]

just replace mydomain with yours.

ABLady
Fri 4th Mar '05, 10:19pm
Thanks sebe,

I'll try these settings.

splooge
Sat 5th Mar '05, 1:45pm
What does Options -> Site Name / URL / Contact Details -> Forum URL contain?

In your apache settings, make sure the path to your documentroot doesn't have a trailing slash. '/'

Also make sure your <Directory /path/to/doc/root> directive doesn't have a trailing slash.

ABLady
Sat 5th Mar '05, 2:54pm
Okay splooge... I'll check the server settings to see about these two items you mentioned.
Thanks for your input.