Re: .htaccess file causing Server Error
Posted: Mon Jan 09, 2012 8:40 am
Well, if you have something such as <img src="images/heading.png"> then yes, that is how it works.
Remember the request to load up the above image comes from the browser, it doesn't know how the server remaps. I thinks that the page is in the directory /page/selector and the above says "From where we are, look for images/heading.png
There are two solutions to it. the first is what I have always been in the practice of, from back in the day when you actually had big sited with static pages so you actually had them in different directories:
Provide the full path (absolute path) to the item from the root of the site, ie <img src="/images/heading.png"> then it does not matter where on the site the file is, it will always grab from the root of the site.
Second method, which I do not prefer as if you do not realize it is there, can mess with where you think things should be later on when you come back is to use the <BASE> tag
http://www.w3schools.com/tags/tag_base.asp
-Greg
Remember the request to load up the above image comes from the browser, it doesn't know how the server remaps. I thinks that the page is in the directory /page/selector and the above says "From where we are, look for images/heading.png
There are two solutions to it. the first is what I have always been in the practice of, from back in the day when you actually had big sited with static pages so you actually had them in different directories:
Provide the full path (absolute path) to the item from the root of the site, ie <img src="/images/heading.png"> then it does not matter where on the site the file is, it will always grab from the root of the site.
Second method, which I do not prefer as if you do not realize it is there, can mess with where you think things should be later on when you come back is to use the <BASE> tag
http://www.w3schools.com/tags/tag_base.asp
-Greg