Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This is the automatically generated htaccess file of WP using permalinks for the pattern /%year%/%postname%/ (working with http://localhost/BLOG-FOLDER/ yet):

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /BLOG-FOLDER/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /BLOG-FOLDER/index.php [L]
</IfModule>

Now the problem is that the rewrite rule applies for http://localhost/BLOG-FOLDER/this-file-does-not-exist, too, and not only for "correct permalinks" such as http://localhost/2012/My-first-entry/.

So, what are the modifications of my htaccess file to get this work?

Thanks a lot! Carlos

share|improve this question
    
Your question is very vague and does not explain exactly what you are trying to accomplish. Give us examples, what do you want it to do if the page doesn't exist? What about if the page does exist? –  Jared Jan 19 '12 at 12:30

1 Answer 1

The web server doesn’t know if a request URI matches a valid permalink.

Handling 404 errors happens in WordPress itself. Your theme should have a 404.php file to return properly formatted output.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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