Home arrow Journal arrow Disable rewrite mode in Apache for a particular directory
Disable rewrite mode in Apache for a particular directory PDF
Wednesday, 22 February 2012
Let's say we have a website which is written in PHP and we rewrite php URLs to look like html except for a particular directory called photos we do not want the URLs to be rewritten.

For that purpose we will add following line in .htaccess file:

 RewriteRule ^photos(/|$) - [L,NC]

Our complete .htaccess rules will be:

  RewriteEngine On
  RewriteRule ^photo(/|$) - [L,NC]
  RewriteBase /
  RewriteRule ^(.*).html $1.php [nc]


Note: Make sure you place this line right after RewriteEngine On, so it will terminate when matched (L - last line matched, NC - no case match too).

Last Updated ( Wednesday, 22 February 2012 )
 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?