regex - Issues with mod_rewrite -
i have problem mod_rewrite.
rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.+)$ $1.php [l,qsa] rewriterule ^article/(.+)$ /article.php?article=$1
this .htaccess. first rewrite_rule, hide file extensions. works without problem. second rule, turn "article.php?article=example" "article/example". whenever try visit page via "article/example" 500 internal server error. first rule works fine , can access page using article.php?article=example.
reverse order of rules , use multiviews
disable content negotiation:
options +followsymlinks -multiviews rewriteengine on rewriterule ^article/(.+)$ /article.php?article=$1 [l,qsa] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.+)$ $1.php [l]
Comments
Post a Comment