Textpattern Forum

You are not logged in. Register | Login | Help

#1 2012-05-11 08:12:53

wavesource
Member
From: Australia
Registered: 2011-08-02
Posts: 21

.htaccess to stop rewriting for subdirectory

Hi all

This might be obvious to many, if not all, but one thing I run into is the TXP .htaccess aggressively 404ing any access to real subdirectories in the root. For example, today I have been handed a site to build that has an old script in the cgi-bin directory. I can’t submit form output to the script without TXP leaping to the rescue with a 404 page, god love it.

What do I do to turn it’s head away at moments like these?

D

Offline

#2 2012-05-11 09:34:57

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,091
Website

Re: .htaccess to stop rewriting for subdirectory

This is not the intended behaviour of Textpattern’s .htaccess rules. In contrary, Textpattern should not even run when “real” files or directories are requested.

One thing I have noticed with certain web server configurations is a bit more complex:

  1. The server tries to render an ErrorDocument (for whatever reason)
  2. This document is not available. Textpattern’s rewrite rules kick in and start Textpattern.
  3. Textpattern tries to serve the requested document it and runs into a 404 of its own because it cannot find a matching article or page in your content.

Try to add these directives to .htaccess to see if this applies to your situation:

ErrorDocument 401 "401 occurred."
ErrorDocument 404 "404 occurred."
ErrorDocument 403 "403 occurred." 
ErrorDocument 500 "500 occurred."

Offline

#3 2012-05-12 01:37:26

wavesource
Member
From: Australia
Registered: 2011-08-02
Posts: 21

Re: .htaccess to stop rewriting for subdirectory

Thank you, kind sir. That did the trick.

Offline

#4 2012-08-01 08:24:39

biggles
Member
Registered: 2007-10-11
Posts: 24

Re: .htaccess to stop rewriting for subdirectory

I am also having htaccess problems after upgrading to Mountain Lion (OSx 10.8). After it broke my local install, I managed to fix Apache and PHP and get access to my databases again via phpMyAdmin. However, I can only access my local install of Textpattern by removing my .htaccess file. With my .htaccess present it serves up a 403 ‘no permission on this server’ error. My local textpattern install is in ‘localhost/~myusername/txp/’ but other directories in my ‘localhost/~myusername/’ directory work fine (they have no .htaccess files!). I tried to add wet’s suggestion above but it didn’t work. Even trying to install Textpattern from scratch gives the same error. Has anyone else had this problem and if so, how did you fix it? Many thanks!

Offline

Board footer

Powered by FluxBB