I have simple rewrite rules as I just learned about them

RewriteEngine On
RewriteRule ^dl/(.*)/.*$ dl/$1/index.php [L]
RewriteRule ^index.php$ upload.js [L]

both are working on Windows for url localhost/upload/dl/mkdji/index.php, but on Debian works only second rule for url www.domain.com/index.php, but not for www.domain.com/dl/oksoks/index.php After dl is some random string. Obviously I'm missing something regarding directory depth, but don't know what. file htacces is in localhost/upload and root of domain.com folders. What am I missing here?


Probably you need the RewriteBase directive. For example:

RewriteBase /
| improve this answer | |
  • now it's working on debian, but not windows. those two are neverending source of confusion. – cikatomo Dec 13 '12 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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