Dynamic Errors

Since I’d switched over to Dynamic publishing, I’ve been unable to access the site stats. Dreamhost does some auto redirecting for requests for a non-existant webpage, to get switched over to the Analog page. Normally, this works fine..

Where it runs into a problem, is with dynamic publishing. The way MT does dynamic publishing, is through some rules in the .htaccess file. Basically, if the file really exists, MT doesn’t try and generate the page. But, if the page doesn’t exist, MT tries to generate the page..

You see where the problem lies don’t you? I need to get to a page that doesn’t exist..but MT won’t give me a page that doesn’t exist….it dynamically generates a 404 error page.. Google, was not my friend for this one.. I couldn’t find any reference to the necessary changes to the .htaccess file to restore access to my non existant stats directory. I was however, able to locate something in Dreamhost’s knowledge base (I know.. who’d have thought the answer would actually be where it belongs?) To help out any others who might be having the problem, and didn’t find an answer.. here’s what works.

Add these lines to your .htaccess:

RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]

RewriteCond %{REQUEST_URI} ^/failed_auth.html$

RewriteRule ^.*$ – [L]

And everthing will be all warm and fuzzy again!