How to get file directory trough .htaccess by using RewriteRule ^(.*)$ ?id=$1 [L,QSA]?

If .htaccess is located in http://localhost/some/dir/.htaccess and I'm opening http://localhost/some/dir/here/I/use/RewriteRule/, how I detect value /some/dir/ without using RewriteBase and without manual adding %{DOCUMENT_ROOT}/some/dir/, like value localhost I get trough %{HTTP_HOST}?

link|improve this question
feedback

1 Answer

mod_rewrite does not know what portion of the URL got it to a specific directory, which is why RewriteBase is needed to generate proper links for relative substitutions in all but the simplest case.

You have to bake this info into your ruleset.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.