mod_rewrite, brainfart!
- Started
- Last post
- 5 Responses
- rounce
Ok well not a 100% legit brainfart seeing as I'm on lots of painkillers*, but I'm having a problem with regexp and mod_rewrite.
Funny thing is the regexp in the RewriteCond works but the RewriteRule begs to differ...
it should do:
/api/getMix/byThread/32/format/j...
to:
/api/getMix/byThread/32.jsonRewriteCond %{REQUEST_URI} /api/(.*)\.([a-z]+)$
RewriteRule /api/(.*)\.([a-z]+)$ /api/$1/format/$2 [L]
http://pastebin.com/m6488e073 (If above is truncated)* I've had 2 teeth knocked out (roots 'n all) and then hammered back in =/
- benfal990
<enter thread>
<exit thread>
- acescence0
^api/([^/]+)/([^/]+)/([0-9]+)/fo... api/$1/$2/$3.$4 [L]
- acescence0
this is a good way to test your rules...
- rounce0
Cheers for changing my train of thought there acescence. It was that bloody preceeding slash!
RewriteCond %{REQUEST_URI} /api/(.*)\.([a-z]+)$
RewriteRule ^api/(.*)\.(.*)?$ api/$1/format/$2 [L]
- ********0
rounceyOUT