View Full Version : Change home directory for html/ssi links

01-26-2011, 06:44 AM

I dont think there is any way to do this, but if there is...

My situation:

The sysadmins give me access to a subdirectory that is in the public_html folder (visible online)

I am building a site that is going to go in the root directory of another server. My problem has to do with relative links.

On the production server the relative links will have to be like "/images/image.jpg" but on the dev server it has to be "/my_dir/images/image.jpg". The same thing applies to ssi links that Im using.

Is there any way to redirect all my links using htaccess or any other methods so my dev server can have teh exact same code as my prod server?

أحمد مصطفى
02-10-2011, 07:59 AM
I think you can use the <base> tag for this, but it causes all links (and image references) on the page to be redirected to the path you specify in its href attribute.

See this tutorial: HTML <base> Tag (http://www.w3schools.com/TAGS/tag_base.asp)

Hope this helps