Please note: I've read through the FAQ and in particular "Relative paths to images...", but my question seems slightly, if not completely, different.
Having said that ...
For a CMS I have developed I use a .htaccess file to rewrite urls like w*w.site.com/home.html to w*w.site.com/index.ph?page=home. Which works perfectly using the lines below:
- Code: Select all
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /index.php?page=$1 [L]
However I've noticed that users of my CMS often want to install the CMS in a deeper folder (www.site.com/cms/home.html). Which makes the lines above non-functional.
I've tried removing the '/' before index.php, but this makes the server look in a folder above the public html folder. I've tried './', but that apparently only works in PHP. I've tried system variables (e.g. %{DOCUMENT_ROOT}, but no luck.
So my question is whether this is actually an option. That the index.php file is looked for in the same directory the .htaccess file resides. Sounds do-able, but I haven't figured it out...
Thanks!