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§ionid=$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§ionid=$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
Post a Comment