Virtualmin stripping www from URL

Hi Guys,

We’ve got a client who’s set their internal network up with the same TLD as their external domain. The client is unwilling to re-do their internal network to industry standards best practices using a subdomain, and consequently they are unable to access the website from inside their network.

I understand that virtualmin redirects http requests to the TLD without the www, but I also know that it ‘should’ be possible to restrict this behaviour, unfortunately, I’ve failed so far to get it to do this.

DNS is not handled through virtualmin, and separate A records have been set up for @ and www pointing to the server. The issue is that when you try to load the website using www.domain.com, virtualmin is stripping the www off and serving only domain.com.

I’ve tried to use the .htaccess file to rewrite the www back in, but that understandable creates an infinite loop.

Is there any way to edit the apache conf for just this domain to have virtualmin preserve the www in the URL?

Been at this for over 6 hours so far and could really use some assistance. I totally understand that this is NOT a standard setup, nor is it adherent to best practices, but this is a client that we can not really afford to lose and so while we agree it’s messy, it’s what we need to do to keep this client happy.

Any advice or assistance would be greatly appreciated.

Thank you!

Todd

Bump… ??

Anyone? :slight_smile:

Howdy,

I understand that virtualmin redirects http requests to the TLD without the www, but I also know that it ‘should’ be possible to restrict this behaviour, unfortunately, I’ve failed so far to get it to do this.

Well, by default, Virtualmin doesn’t actually redirect. The default is that whether you use www, or no www, it would access the site using that particular domain.

You may want to verify that there isn’t a .htaccess file that’s redirecting, or that the application that’s being accessed isn’t causing it to redirect.

There are non-default settings that can cause a redirect – to see if those are enabled, we’d need to see the section of your Apache config for this domain. To do that – which distro/version are you using?

-Eric