php - mod_rewrite and .htaccess exception to the rule -


I want to hide the .php extension across my site, I have this snippet and it works fine. Although I have a URL which I want to be an exception to the rule, I want the .php to be retained and it's the $ _GET parameter.

How can I include that exception in this snippet? And why does this work?

  option + follow link -multi view #RedriteEnzine on #Redrivebase # Turn on mod_rewrite / ## hide .php extension #dir/foo.php to external / /dir / foo redirect RewriteCond% {THE_REQUEST} ^ [AZ] {3,} \ s ([^.] +) \ .PP [NC] Reerratriel ^% 1 [R = 302, L] # Internally forward / DAY / FU Two / Dir /foo.php rewrite code% {REQUEST_FILENAME}! -d Rewrite code% {REQUEST_FILENAME} .php -f Rewrite rules ^ (. *?) /? $ $ 1.php [L]    

You can add exceptions like this :

  option + follow link -Multi view #RedriteEnzine Turn on redrawetbase to hide mod_rewrite / ## to hide .php extension # / / dir / foo to redirect / dir / foo php reprint% {THE_REQUEST} ^ [AZ] {3,} \s ([^.] +) \. Php [NC] RewriteRule! ^ (Exception 1 | Exception 2)% 1 / [R = 302, L] # Internally forward / from DIR / Foo /dir/foo.php Rewrite angle% {REQUEST_FILENAME}! -D rewrite code% {REQUEST_FILENAME} .php -f Rewrite rules ^ (. *?) /? $ $ 1.php [L]   

BTW code and comment I wrote it in the past :)

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -