Question

I have a website which I am updating the URLs for i.e. rewriting to be more SEO friendly. By doing this, it has broken a lot of the links to scripts/images on the various pages. The only way around this (from what I can tell) is to use the absolute path to the scripts/images on the pages.

Now unless I am mistaken (or missing something) this should be pretty safe to do? Anyone who knows anything about websites and/or web development would be able to work out directories to images/scripts by simply looking at the current URL and matching it up against the relative paths anyways.

I would like to know if there are any real reasons why this would be an issue.

Thanks.

Was it helpful?

Solution

There are no security implications, but it will make life harder for you if you ever move your site (e.g. to a different domain), since you'll have to update all URLs from http://www.example.com/media/mynicepicture.jpg to http://www.mynewexample.com/media/mynicepicture.jpg. If you use relative URLs, you don't need to update your URLs if/when you move domains.

OTHER TIPS

There are absolutely no security implications for using absolute URIs instead of relative URIs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top