apache - Excluding filename using RewriteRule -


i want pipe uris index.php unless specific file exists in root. i'm little stumped when comes excluding index.php of course won't match last catch rule

options +followsymlinks -indexes rewriteengine on  rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewritecond %{request_filename} != "index/.php" // i'm not sure on syntax here rewriterule ^(.*)$ $1.php [l]  rewriterule ^([^/]*)(.*)$ index.php?category=$1&post=$2 [l,qsa] 

solved adding additional conditions last rule

rewritecond %{request_filename}\.php -f rewriterule ^([^\.]+)$ $1.php [l]  rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^([^/]*)(.*)$ index.php?category=$1&post=$2 [l,qsa] 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -