Saturday, August 1, 2009

Keeping Wordpress from overwriting .htaccess rules

.htaccess file is a small Apache file that lets you do all sorts of funky things with requests made to your server.

A typical .htaccess file looks like this

# BEGIN wordpress
[ifmodule mod_rewrite.c]
rewriteEngine On
rewriteBase /
rewriteCond %{REQUEST_FILENAME}!-f
rewriteCond %{REQUEST_FILENAME}!-d
rewriteRule . /index.php [L]
[/ifmodule]
# END wordpress

Wordpress rewrites the section between '# BEGIN wordpress' and '# END wordpress' from time to time. Hence any custom rules written by you must be written outside this section. Never place your own rules within the ‘wordpress’ block

No comments:

Post a Comment