# Mod rewrite & relative urls

**URL:** https://forum.kirupa.com/t/mod-rewrite-relative-urls/281153
**Category:** programming
**Created:** [February 5, 2009, 3:31pm UTC](https://forum.kirupa.com/t/mod-rewrite-relative-urls/281153 "2009-02-05T15:31:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Neolumi](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/neolumi/32/1306_2.png) [@Neolumi](https://forum.kirupa.com/u/Neolumi)
#### Post date: [February 5, 2009, 3:31pm UTC](https://forum.kirupa.com/t/mod-rewrite-relative-urls/281153/1 "2009-02-05T15:31:10Z")

</div>

Hi All,

I’ve been wondering this for a while, say you have a htaccess file with rewrite rules that create urls such as:

[www.website.com/books/horror/](http://www.website.com/books/horror/)

And you use relative url’s to refer to external css files e.g. ‘css/global.css’, how can you retain this whilst still having directory style rewrites without the use of the ‘base’ html tag. A good example of this is the new american government site, directory style rewrites, but relative references to javascript, css, etc.

[http://www.whitehouse.gov/administration/staff/](http://www.whitehouse.gov/administration/staff/)

Anyone know how this is done?
