Can I create virtual directories on local server
I've installed Apache HTTP Server as testing (local host) server.
I'm developing more than one web site on one computer.
So I put some sub-directories (like site1, site2,...) on DocumentRoot of apache.
So I want to use URL prefix for every sites as
http://localhost/site1/
http://localhost/site2/
But when I publish a site on a remote server, we can able to put all files without top level sub folders (I mean site1,site2,...); because one virtual directory (domain) contains one site
This changes between local & remote servers confusing my dynamic page scripts & relative links of pages.
For example
if we want to link directly a page on top level directory we want to give URL
On local server: site1/index.htm
On Remote Server: /index.htm
So I want to change every links and scripts before I publish it on remote server.
I know most web designers design many sites on period.
But how can they do that easily?
Re: Can I create virtual directories on local server
The point of relative links is that they do not break when the base URL is changed. You must be using absolute references, not relative ones.
Note that if you start a path with a slash (/) it is an absolute reference.