FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Question about .htaccess' mod_rewrite





Fire Boar
I don't know if there's a simple answer for this, but Google failed to give the information I'm looking for. So here goes.

My question is, is it possible to specify a base directory for everything that comes into the file?

For example, if I rewrite index.php?thing1=bob&thing2=fred to bob/fred.html, if there were images to be generated, they would come out as bob/images/... rather than images/... since I'm using a relative path.

Is it possible or do I have to use exact urls for everything?
mathiaus
Code:
<base href="http://me.com/images" />

Before closing head tag. This will affect all relative page links as well though.
You could also try rewriting image urls something like below (just an idea)
Quote:
RewriteRule ^(.*)/images/(.*)$ /images/$2
Fire Boar
Excellent. The base tag did the trick nicely. I'm glad I don't have to go through changing all image tags to use full paths.

Thanks. Very Happy
Related topics
A Question For .htaccess
.htaccess i mod_rewrite
.htaccess .htpasswd
.htaccess and FTP
.htaccess instead of mod_rewrite
[SOLVED] Using mod_rewrite.
only .htaccess instead of mod_rewrite
My sig is not working
[HELP]redireccion de subdominios por medio de .htaccess
htaccess question...
question about .htaccess mod_python with publisher mod
[var]La pesadilla del dominio y host propio
PHP and .htaccess
Show People's IP In a Pic
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.