0

I have just realised something that I never knew and I wanted to get confirmation that it is expected behaviour or whether the website I am working was behaving incorrectly.

I creating a page - lets call it "page".

Whenever I went to this page, I getting the following message: Directory Empty

I then discovered I had a directory in the root Wordpress directory called "page" which was empty - so I deleted it and it worked.

Is it correct that Apache will check locally first before allowing htaccess to process the Wordpress permalinks? Is this normal, expected behaviour?

1 Answer 1

1

It is the way the .htaccess wordpress generatea instructs apache to work on the wordpress directories

The relevant parts from the default .htaccess

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

The first line will cause the rewrite engine to bail out if there is a file with the same name as the server is asked to serve

The second line will cause the rewrite engine to bail out if there is a directory with the same name as the server is asked to serve

The third line is what actually invokes wordpress and you will not get to it if you bailed out on one of the first two lines.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.