[Bug?] Why accessing www.doe.com/john (without trailing /) will redirect to doe.com/john?

I noticed there a strange phenonmenon with websites created with VMpro.

When you access http://www.doe.com/john (without / at the back of the URL), you will be redirected to http://doe.com/john/ (notice www is removed).

If you access http://www.doe.com/john/ (with the trailing /), everything works as normal i.e. without the redirection).

Can anybody tell me why? Is it because of certain directives in httpd.conf? How do I stop the redirection to URL without the www?

Thanks.

I wasn’t able to duplicate the problem with either IE or Mozilla browsers, though I’m not sure what the problem is. Are you trying to run an intranet and an Internet on that server?

Jamie provided the solution:

This is actually an Apache configuration issue. To fix it, do the following :

  1. Go to Webmin’s Apache Webserver module.
  2. Click on the Default Server link
  3. Click on Networking and Addresses
  4. Change ‘Use hostname supplied by browser’ to ‘Yes’
  5. Click on Save
  6. Click on Apply Changes

Hi Dan,

The problem is, some scripts I run are very anal about having www. in the URL. If www is missing, some things don’t work. Don’t ask me why. I don’t know either. I’m just a lowly end-user. :wink:

Jamie’s solution (above) solved the issue. But I was wondering what exact change is needed on httpd.conf.

I believe that option sets the "usecanonicalname off" setting globally in httpd.conf

Thanks Daniel.