so I have it rewriting .html to .php, but then it won’t load .html files when I need it to. Is there a way to get it to ignore the bookstore directory? I thought I have that in there already, but it doesn’t work.
/public_html/.htaccess
Options +FollowSymlinks
DirectoryIndex index.php index.html index.htm
RewriteEngine on
RewriteCond %{REQUEST_URI} "/bookstore/"
RewriteRule ^(.+)\.html$ http://virtualbookworm.com/$1.php [L]
ErrorDocument 404 /error.php
../bookstore/.htaccess
Options +FollowSymlinks
DirectoryIndex index.php index.html index.htm
Options +Indexes
ErrorDocument 404 /error.php
To ignore the bookstore directory, you need a
!in front of the expression:Or, you can just turn on the rewrite engine in the htaccess file in the
bookstoredirectory and the rules in your document root will be superceded:Additionally, the inclusion of the
http://virtualbookworm.comin the rule’s target will cause the browser to be redirected (using a 302 response) and it’ll change the URL in the address bar. If that’s not what you want, just remove it: