Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- Date: Sat, 21 Oct 2006 13:59:40 +0900
- From: Dave M G <martin@example.com>
- Subject: [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- User-agent: Thunderbird 1.5.0.7 (X11/20060922)
TLUG,
I have a few web sites that I maintain, and do various editing and whatnot on my home machine.
The basic set up at home is that the files for each web site are in their own directory within my /var/www/ directory, like so:
/var/www/website_one/index.php /var/www/website_two/index.php
When I want to access them through my local Apache server, I can get there with:
http://localhost/website_one/ http://localhost/website_two/
So far so good.
But what I've discovered is that when working with PHP, and linking to subdirectories and parent directories, it can get a little confusing.
For example, if I'm in http://localhost/website_one/subdirectory/, and I want to go to the root directory, I can't simply type in <a href="/">link</a>. If I do, then the link will take me to http://localhost, which is too far down.
On the other hand, I can't make the link <a href="/website_one">link</a>, because if I do, then when I upload the files to hosting service where they are actually served to the internet, the directories won't match anymore.
What I'd like to be able to do is make it so that on my local machine, when accessing each web site's directory, the server behaves as if the web site's own directory is it's root directory. Then I can test at home and upload to my hosting service without having relative links break on me.
Is this possible in any way?
ï-- Dave M G Ubuntu 6.06 LTS Kernel 2.6.17.7 Pentium D Dual Core Processor PHP 5, MySQL 5, Apache 2
- Follow-Ups:
- Re: [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- From: Godwin Stewart
- [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- From: stephen
- Re: [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- From: Edward Wright
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Linux and Windows {2k|Xp|Vista} Comparison
- Next by Date: Re: [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- Previous by thread: Re: [tlug] Search Engines
- Next by thread: Re: [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links