.htaccess - htaccess rewrite rule for multiple pages -
this seems simple, it's not working me. trying have both show.php?id=$1 , producer.php?id=$1 rewrite friendly urls. first 1 works perfectly, second not. if remove first, second works fine.
what doing wrong here?
my code:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]*)\.html$ /show.php?id=$1 [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]*)\.html$ /producer.php?id=$1 [l] </ifmodule>
thanks in advance!
your problem quite simple.
you cannot have more 1 rewrite rule same directory, need have separate folder each ie. have folder called "show" , have htaccess file contains rewrite data show.
.htaccess show folder:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]*)\.html$ /show.php?id=$1 [l] </ifmodule>
then have folder called "producer" 2nd rewrite rule.
.htaccess producer folder:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]*)\.html$ /producer.php?id=$1 [l] </ifmodule>
Comments
Post a Comment