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

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -