Welcome to WebmasterWorld Guest from 18.104.22.168
I have been playing around with mod_rewrite, and I finally manager to do the following thing. I have a dbase driven cheats website, divided into several platforms we enter a section by using "cheats.php?action=showtitles&platform=n64"
Now I wanted to make the url to the Nintendo 64 look like this [thisisnottherealurl.com...] I kinda managed to do this, with the following .htaccess file:
RewriteRule (^(.*)/) cheats.php?action=showtitles&platform=$2 [L]
This works just fine, except for the fact that all links to f.e. the CSS file wich is called by cheats.php is no longer valid, since it is trying to call for /n64/style/1.css instead of /style/1.css
Is there something I can do about this?
This will do the rewriting only if both the rewritecond condition and the rewriterule match. The RewriteCond matches any URI that does not contain .css or .js.
<base href="http://www.domain.tld/test/" />
Now all relative URIs will be resolved relative to that URI.
<img src="images/test.gif" /> will always be resolved to [domain.tld...] no matter whether the actual URI cheats.php was accessed by is /test/dreamcast/ or /tets/n64/A/.