Local webdeveloment with Apache: treating folders as domains
Posted: Sat Dec 24, 2005 8:19 am
Hi everyone,
Currently I'm experimenting with URL rewriting (within Apache) for usabilty and search engine optimization purposes. Everything works fine on the hosting platform running the website on its domain. However, my local development setup is not quite suitable for testing URL rewriting locally, because the directory structure is different. Suppose I have a website for the domain site.com and I'm using URL rewriting.
Root:
http://www.site.com
(redirected to file: home.php)
Homepage:
http://www.site.com/home
(redirected to file: home.php)
Some product:
http://www.site.com/products/13
(redirected to file: products.php?productId=$1)
Now, locally I enter this site by the following URL:
http://localhost/site.com/
It follows that, especially with URL rewriting, this setup (where the root is different) is problematic regarding (absolute) paths.
My questions concerns this issue. Is there a way to configure Apache to treat directories on localhost as absolute domains? So, for example, that the root of http://localhost/site.com/ is not localhost, but, indeed, site.com? That way developing with URL rewriting is much easier, because the local setup, regarding the file structure, compares to the live one.
Thanks in advance!
Currently I'm experimenting with URL rewriting (within Apache) for usabilty and search engine optimization purposes. Everything works fine on the hosting platform running the website on its domain. However, my local development setup is not quite suitable for testing URL rewriting locally, because the directory structure is different. Suppose I have a website for the domain site.com and I'm using URL rewriting.
Root:
http://www.site.com
(redirected to file: home.php)
Homepage:
http://www.site.com/home
(redirected to file: home.php)
Some product:
http://www.site.com/products/13
(redirected to file: products.php?productId=$1)
Now, locally I enter this site by the following URL:
http://localhost/site.com/
It follows that, especially with URL rewriting, this setup (where the root is different) is problematic regarding (absolute) paths.
My questions concerns this issue. Is there a way to configure Apache to treat directories on localhost as absolute domains? So, for example, that the root of http://localhost/site.com/ is not localhost, but, indeed, site.com? That way developing with URL rewriting is much easier, because the local setup, regarding the file structure, compares to the live one.
Thanks in advance!