apache - htaccess doesn't rewrite all the rules -


as i'm new .htaccess, i'm trying take easy on how use it. i'm rewriting urls though problem is, if rewrite 3 urls, top 1 1 working.

rewriteengine on

rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d  rewriterule ^forums/([^/]*)/([^/]*)/$ /forums.php?page=$1&sectionid=$2 [l] rewriterule ^forums/([^/]*)/topic/([^/]*)/$ /forums.php?page=$1&topic=$2 [l]  errordocument 400   /error.php errordocument 401   /error.php errordocument 403   /error.php errordocument 404   /error.php errordocument 500   /error.php 

so, if add new rule above first one, 1 working. using wrong way?

also, how rewritecond work?

try removing [l] flag or create separate rewritecond each rule,

rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^forums/([^/]*)/([^/]*)/$ /forums.php?page=$1&sectionid=$2  rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^forums/([^/]*)/topic/([^/]*)/$ /forums.php?page=$1&topic=$2 [l] 

use [l] on last rule.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -