Forum Moderators: phranque
My new host provider provides a temporary location:
[server.hostprovider.com...]
I'm using "server relative" links (see JPMorgan NOTES below):
<href="/about/">about</a>
Since the temporary hosting space is one directory down and the web site uses relative links with the leading slash pointing to root, all the text and image links break. The host provider says this is only temporary until the DNS is updated and the site becomes www.mysite.com. Is there a simple .htaccess or httpd.conf rule that would allow the site to work using "server relative" links?
Thank you.
NOTES (JPMorgan on relative vs. absolute links):
Source: [webmasterworld.com...]
Page-relative: <img src="image.gif"> or <img src="../image.gif"> or <img src="images/image.gif"> or <img src="../images/image.gif>"
Server-relative: <img src="/image.gif"> or <img src="/images/image.gif>"
Absolute or canonical: <img src="http://www.example.com/image.gif"> or <img src="http://www.example.com/images/image.gif">
Another thing to consider, to prevent this problem, is to get (pay for) a unique IP address for your new host. With a unique IP address, you can test your new site/host using that new IP address, and the whole problem is avoided.
Jim
[edited by: jdMorgan at 12:27 am (utc) on July 13, 2008]