Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Mac OS X - Apache Server - Relative Path

Mac OS X - Apache Server - Relative Path
Thread Tools
Mavro101
Fresh-Faced Recruit
Join Date: Jun 2007
Status: Offline
Reply With Quote
Jun 26, 2007, 01:49 PM
 
Hi Everyone,

I am new to this forum so please be easy on me. I am a Web developer that uses Mac OS X. I am trying to use OS X's built in Apache server to test my sites locally before I deploy them to my staging or production servers. Unfortunately I am having a problem with path. When files the same directly as the HTML file I am accessing are referenced they load fine but when a file is any subfolder or any other path it will not load.

For example:
<img src=”foo.jpg"> - Works
<img src=”images/img.jpg"> - Does not work

Has anyone else encountered this and if so do you know a way to fix it? I have searched this forum for this issue and was not able to find anything so I apologize if this has already been answered.

Thanks!
Mavro
( Last edited by Mavro101; Jun 26, 2007 at 02:07 PM. )
     
OreoCookie
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Jun 26, 2007, 04:51 PM
 
Add ./ to the second line: <img src="./images/img.jpg"> should work. ./ adds the path of the html file.
I don't suffer from insanity, I enjoy every minute of it.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jun 26, 2007, 06:31 PM
 
What problem are you having calling files from subfolders? Permission denied? File not found? Check your Apache logs through the command line or through the Console application, this will tell you exactly what is going on.
     
   
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 10:53 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,