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

**URL:** <https://forum.virtualmin.com/t/bug-why-accessing-www-doe-com-john-without-trailing-will-redirect-to-doe-com-john/26687>\
**Category:** Virtualmin\
**Created:** [May 17, 2007, 12:12pm UTC](https://forum.virtualmin.com/t/bug-why-accessing-www-doe-com-john-without-trailing-will-redirect-to-doe-com-john/26687 "2007-05-17T12:12:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ah\_lifes\_good](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@ah\_lifes\_good](https://forum.virtualmin.com/u/ah_lifes_good)\
**Post date:** [May 17, 2007, 12:12pm UTC](https://forum.virtualmin.com/t/bug-why-accessing-www-doe-com-john-without-trailing-will-redirect-to-doe-com-john/26687/1 "2007-05-17T12:12:24Z")

</div>

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

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

If you access [http://www.doe.com/john/](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.

---

<div class="post-metadata">

**Author:** ![DanLong](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@DanLong](https://forum.virtualmin.com/u/DanLong)\
**Post date:** [June 7, 2009, 12:03pm UTC](https://forum.virtualmin.com/t/bug-why-accessing-www-doe-com-john-without-trailing-will-redirect-to-doe-com-john/26687/2 "2009-06-07T12:03:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ah\_lifes\_good](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@ah\_lifes\_good](https://forum.virtualmin.com/u/ah_lifes_good)\
**Post date:** [June 7, 2009, 12:03pm UTC](https://forum.virtualmin.com/t/bug-why-accessing-www-doe-com-john-without-trailing-will-redirect-to-doe-com-john/26687/3 "2009-06-07T12:03:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ah\_lifes\_good](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@ah\_lifes\_good](https://forum.virtualmin.com/u/ah_lifes_good)\
**Post date:** [June 7, 2009, 12:03pm UTC](https://forum.virtualmin.com/t/bug-why-accessing-www-doe-com-john-without-trailing-will-redirect-to-doe-com-john/26687/4 "2009-06-07T12:03:05Z")

</div>

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. 😉

---

<div class="post-metadata">

**Author:** ![ah\_lifes\_good](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@ah\_lifes\_good](https://forum.virtualmin.com/u/ah_lifes_good)\
**Post date:** [June 7, 2009, 12:03pm UTC](https://forum.virtualmin.com/t/bug-why-accessing-www-doe-com-john-without-trailing-will-redirect-to-doe-com-john/26687/5 "2009-06-07T12:03:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DanielLlewellyn](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/d/f6c823/32.png) [@DanielLlewellyn](https://forum.virtualmin.com/u/DanielLlewellyn)\
**Post date:** [June 7, 2009, 12:03pm UTC](https://forum.virtualmin.com/t/bug-why-accessing-www-doe-com-john-without-trailing-will-redirect-to-doe-com-john/26687/6 "2009-06-07T12:03:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ah\_lifes\_good](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@ah\_lifes\_good](https://forum.virtualmin.com/u/ah_lifes_good)\
**Post date:** [June 7, 2009, 12:03pm UTC](https://forum.virtualmin.com/t/bug-why-accessing-www-doe-com-john-without-trailing-will-redirect-to-doe-com-john/26687/7 "2009-06-07T12:03:12Z")

</div>

Thanks Daniel.

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [April 30, 2020, 5:41am UTC](https://forum.virtualmin.com/t/bug-why-accessing-www-doe-com-john-without-trailing-will-redirect-to-doe-com-john/26687/8 "2020-04-30T05:41:39Z")

</div>

Closed on April 30, 2020, 5:41am UTC


