Rearrange Virtual servers

In some cases, it is necessary to rearrange the order in which Apache parses the virtualservers. This is especially important when multiple sites use .htaccess files and rewrite rules that interfere with each other. There should be a way to rearrange the servers in the gui.

Status: 
Active

Comments

Howdy -- you can set which domain is the default (ie, which appears first) by going into Server Configuration -> Website Options. Then, you can set the domain to be the default for the IP address.

There otherwise isn't a way to re-order domains, though other than the default it shouldn't matter what order they're in.

The rewrite rules shouldn't interfere with each other at that point.

Though if you're still seeing problems after changing the default domain, could you explain what issue it is you're seeing exactly?

Its complicated however i had to manually move the virtual server entry in the conf file to resolve my issue based on how .htaccess files are parsed. a joomla website with a wordpress subdomain is one way to recreate the issue. The .htaccess files for joomla take over the entire domain (including subdomains) and redirect "missing" information to Joomlas 404 error page. This is done in the .htaccess file and if the wordlress entries are lower in the conf file, the wordpress site will not work. Once the wordpress site is moved in the conf file, it works fine. Each .htaccess is parsed in the order of the server in the conf file.

Are you sure that the server order matters? The .htaccess files are in the filesystem and not in the Apache config, and they are parsed in depth-first directory order.

Yes I am sure.