views:

54

answers:

2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin/([^/]+)/([^/]+).php website.com/admin/index.php?route=$1/$2 [NS]
RewriteRule ^modules/([^/]+)/([^/]+).php website.com/admin/index.php?route=$1/$2 [NS]

the above works for when you login. it goes to /admin/modules/catalog but when you click on a link that shows up in the status bar as /admin/vendors/ it doesnt work???? which vendors is a sub dir or modules/

any idea

+1  A: 

Considering what is said in the documentation about RewriteCond, and what you get, I'd say that the RewriteConditions are only applied to the one RewriteRule that follows :

The RewriteCond directive defines a rule condition. One or more RewriteCond can precede a RewriteRule directive. The following rule is then only used if both the current state of the URI matches its pattern, and if these conditions are met.

What if you try duplicating those RewriteCond in front of the second RewriteRule ? At least as a test ?


And here is an interesting thing about the S|Skip flag. Amongst other things and an example, it is said :

The [S] flag is used to skip rules that you don't want to run. This can be thought of as a goto statement in your rewrite ruleset.

And also :

This technique is useful because a RewriteCond only applies to the RewriteRule immediately following it. Thus, if you want to make a RewriteCond apply to several RewriteRules, one possible technique is to negate those conditions and use a [Skip] flag.

I've never tried this, but it might be useful, in your situation... maybe ^^

Still, it's some part of the Apache's documentation that seem to indicate what I said earlier is right.

Pascal MARTIN
"RewriteConditions are only applied to the one RewriteRule that follows" Didn't even catch that, nice work.
Akoi Meexx
A: 

Assuming poor English? It sounds like you're requesting /admin/vendors; but you're saying that vendors is located in /modules.

Akoi Meexx