RewriteEngine On
RewriteBase /
RewriteRule ^admin/.*$ - [PT]
# Use the above line for a folder that you DON'T want to follow these rules
RewriteRule ^/?([a-zA-Z0-9-_/]+)/$ $1.php [L]
# Here's where the "magic" happens
# http://www.example.com/page.php - OLD
# http://www.example.com/page/ - NEW
# enable site
sudo a2ensite
# disable site
sudo a2dissite
# enable an apache2 module
sudo a2enmod
# e.g. a2enmod php4 will create the correct symlinks in mods-enabled to allow the module to be used. In this example it will link both php4.conf and php4.load for the user
# disable an apache2 module
sudo a2dismod
# force reload the server:
sudo /etc/init.d/apache2 force-reload
<Directory "/example/htdocs/wp-content/uploads/">
php_admin_flag engine off
</Directory>
<Directory "/example/htdocs/wp-content/themes/">
<Files *php>
Order allow,deny
Deny from all
</Files>
</Directory>