Recently I've encountered an issue where some pages 404 when accessed via their cruftless paths.
The same pages work when a query string, like ?1234
or index.php
is appended to the path.
Example:
http://pagesofinterest.net/code/plugins/code-complete/ - Fail
http://pagesofinterest.net/code/plugins/code-complete/?123 - Success
http://pagesofinterest.net/code/plugins/code-complete/index.php - Success
I'm not sure if this is a mod_rewrite or a caching issue.
Here is the content of my .htaccess file:
# Use PHP5.3 Single php.ini as default
AddHandler application/x-httpd-php53 .php
#ExpiresDefault A0
Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
Header set Pragma "no-cache"
DirectoryIndex index.php index.html
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.pagesofinterest.net [NC]
RewriteRule ^(.*)$ http://pagesofinterest.net/$1 [R=301,NC]
# Error documents
ErrorDocument 404 /404.php
ErrorDocument 403 /404.php
ErrorDocument 500 /500.php
# compress a few file extensions
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/html
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch ^MSIE !no-gzip !gzip-only-text/html
<IfModule mod_expires.c>
# explicitly disable caching for scripts and other dynamic files
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
Redirect /mikes http://pagesofinterest.net/blog/
Redirect /code-of-interest http://pagesofinterest.net/code
# Redirect all old photo pages to the tiny new one
RewriteCond %{REQUEST_URI} ^/photos/[a-z\/]+$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ http://pagesofinterest.net/photos/ [R=301,L]