Monday, January 1, 2024

(REPEAT) one weird trick for making a page think it's somewhere else

Haven't thought of this trick for years, but it's good to know about:

if you're ever updating a page that might, say, usually live on a remote server, but you want to edit it locally, and without pulling down all the css, images, etc, you can tell the page that all relative links actually should be based on a specific URL using the <base> tag... for instance, I'm editing the front of alienbill.com so I put

<base href="http://alienbill.com/">

at the top.

In effect, it makes pretend that the page is at that location for purposes of image references, stylesheets, etc.

No comments:

Post a Comment