I use WampServer in order to test my sites locally. I'm reorganizing my development environment and I faced this issue:
I want to have multiple folders inside the root www folder of WampServer. Each subfolder represents one site.
My problem now is that every relative link that starts with /
is not working, since it takes localhost
as the root instead of localhost/subfolder/
. For example:
<a href="/">...
<img src="/images/...
Also, every site has its own .htaccess
file and inside I use RewriteBase /
. Now, this line breaks all my RewriteRules
since takes /subfolder/
as part of the URL.
My only idea to solve this is by using virtual hosts for every site, so instead of having localhost/subfolder/
, I will have something like subfolder.dev
.
Changing relative links or .htaccess
files of all my existing sites is not an option. Virtual hosts seems to be what I need, but it requires modifying conf/extra/httpd-vhosts.conf
and c:\windows\system32\drivers\etc\hosts
every time I add a new site.
Is there any other way to configure my WampServer (Apache) to work in the way I need?
Update: I just finish to configure Virtual hosts for all my sites and everything works perfect. So, I leave the question open in case there exists an easier solution.
By the way, how does paid hostings deal with multiple domains under one customer account? Do they use Virtual hosts too?