Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-17-2012, 10:07 PM   PM User | #1
Kurisvo
New Coder

 
Join Date: Apr 2011
Posts: 59
Thanks: 8
Thanked 0 Times in 0 Posts
Kurisvo is an unknown quantity at this point
Problem with localhost/xampp

Just a quick question for you guys.

I develop on xampp and I develop multiple sites in sub-folders. My problem is that it's not letting me use each sub-folder as its own site.

So say I'm coding on site a. And in it I want image and I call it like I would on a webserver with <img src="images/a.gif"> and then on site b I call it like <img src="image/b.gif">. Each sub-folder has it's own images folder.

The problem is, instead of image a calling localhost/a/images/a.gif like it would on a web-server is calls localhost/images/a.gif. Is there a way to fix this other then calling it using localhost/a/images/a.gif? Because I would hate to have to do that and then rewrite all the links when it came time.
Kurisvo is offline   Reply With Quote
Old 01-19-2012, 02:55 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Use a relative path for the images instead. The behaviour is otherwise normal since these are subdirectories and not site roots, so when it wants to look from the root it will go directly from localhost and not localhost/x. You can also lock the site root in using html's base tag which can be used temporarily while developing (which is IMO the fastest way to write a simple test up).
So IMO you should either use a base to temporarily change the location of the base url, or you should use relative paths instead.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:07 AM.


Advertisement
Log in to turn off these ads.