Barney Chambers Barney Chambers - 4 months ago 5x
HTML Question

Using HTML href="" on section of URL string

I have a URL Can I use href= in such as way:

<a href="/hello/world">LinkText</a>

In other words, because of the versioning repository I use for work, only the sublink
of the final URL will the same when I push the site live.


For reference, see the docs

However, in href, you can either use an absolute URL, such as or, relative, something like /bar.html, where / refers to the webserver root (but not webserver's system root), or, you can use bar.html which points to a file in the same directory level.

Basically you want to have a /hello/world link, it will point to

If you want it to point at, you can either rewrite the URL on the server, or, redirect the users to

For URL rewriting, see your appropriate webserver docs