Three options:
1) Use a base tag (this will affect every relative URI on your page, including links, images, scripts, style sheets, etc.)
<base href="http://yoursite/">
2) Change all your links to fully qualified URIs
<a href="http://yoursite/yourpage.html">
3) Use the "/" prefix to indicate that the path refers to the root in each URI.
<a href="/yourpage.html">
I personally used the base tag option, which causes some bad printing (from people who used it without understanding it). When it comes to mod_rewrite, the base tag is perfect as you probably want all your paths to be relative to the root, including all your images, css, scripts and links.
source share