preventing links from going to server root
# September 30, 2009 at 10:13 am
I am currently working on a basic site using PHP includes that I am testing locally using MAMP. I am not using dreamweaver so I don’t have the luxury of auto updating links when I transfer to a server.
The problem is I work on the site locally and it works fine. But when I upload it to http://www.mydomain.com/_clients/_folder_name_ all of my links break because I am using links such as href="/img/image-name.jpg".
How would I prevent the link from going to my domains server root and just stay inside the folder. Is this something an .htaccess file would do? If so could someone explain how that works?
Much appreciated!# September 30, 2009 at 2:43 pm
Hey TheDoc. Thanks for the reply. Unfortunately that is exactly the problem the folder structure is different. Let me add more detail.
I am a freelancer and create multiple sites so I need a folder on my website to place multiple jobs so for example.
I send the client the link above to review the design. But the problem arises when I have links like. /img/image.jpg because it travels all the way to the domian root folder. What I need is a way to say hey stop here at job1 and get the img folder.
and then when the client approves the design I need to take the approved job and put it to their server.
So point A and point C are the same. But when I load it to my client folder on my site the links break.
Thank you for helping.
You must be logged in to reply to this topic.