Problem with .htaccess (mod_rewrite). RewriteRule's doens't work correctly

Posted by daniel on Stack Overflow See other posts from Stack Overflow or by daniel
Published on 2010-05-24T10:27:36Z Indexed on 2010/05/24 10:31 UTC
Read the original article Hit count: 157

Filed under:
|

Hello,

I have a problem with my two RewriteRules.

.htaccess:

# protect the htaccess file
<files .htaccess>
 order allow,deny
 deny from all
</files>

RewriteEngine On
Options +FollowSymlinks
Options -Indexes
RewriteBase /test/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^download/([0-9]+)$ download.php?id=$1 [L]
RewriteRule ^(.*)$ index.php?c=view&misc=$1 [B]

If the url contains download (some like this: mydomain.com/download/9) the first rule should redict this request to download.php?id=9. But it doesn't.

var_dump($_GET) shows the following:

array(2) { ["c"]=>  string(4) "view" ["misc"]=>  string(9) "index.php" } index.php

Any ideas?

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about mod-rewrite