I've my mod_rewrite setup to ensure that it redirects all demands that are not focusing on existing files or sites to index.php?req=* where * may be the request.

Works all fine however when I send the browser to something similar to this:


The browser attempts to find all images, stylesheets within the non-existing folder C. How do i result in the browser to appear in / rather than the 'virtual' directory?

Must i put a complete path everywhere?

You should utilize absolute Web addresses (or at best absolute URL pathways) when referencing the assets. So http://example.com/foo/bar or /foo/bar rather than foo/bar or ./foo/bar.

Because otherwise the URL path from the current document can be used as base path the relative pathways are then resolved from.

One other way is always to alter the base URL using the [cde] element like:


This can alter the base URL road to <base href="/"> . But observe that this can affect all relative Web addresses and not simply individuals having a relative URL path.

Yes. Either such as this:


or using HTML's [cde].

I'd prefer changing the <img src="/image.jpg" /> , though. It's a lesser hassle.

Must i put a complete path everywhere?