views:

377

answers:

2

this is my WP htaccess

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

i want wordpress' htaccess to stay out of the way when the link is to a standalone .html|.htm file inside the /ag directory.

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/ag
RewriteRule . /index.php [L]

doesnt work (i am aware the above code doesnt even try to implement the requirement that the file ends in .html|.htm). what do I need?

thanks in advance!

+1  A: 

The original rewrite conditions only rewrite if the file does not exist, and is not a directory.

Therefore if you have the file in a directory, there should be no rewrite happening.

Simeon Pilgrim
the original is the default wordpress htaccess and has nothing to do with my specific needs, as detailed in this question. with the original setup i get a wordpress-styled 404, even when the file i am requesting exists in the directory
Gaia
if a file exists and your webserver can display it, it will. This rewrite rules say, if the file does not exist, call this php file(which just happens to be part of WordPress). And WordPress will then decide no such file is a related to WordPress and therefore show the WP 404.Test this by remove the .htaccess file, and seeing what happens, when you try access your .html file.
Simeon Pilgrim
What I'm saying is, what your asking for works out-of-the-box for a normal install. I don't think your problem is the .htaccess file, but something more server related.
Simeon Pilgrim
A: 

Simeon's last comment nailed it. it turns out the file being requested had been deleted. the default rewrite rules do not need an exception when the file actually exists.

thanks!

Gaia
Glad to help. You're welcome to tick my post to mark it the answer.
Simeon Pilgrim