Page 2 of 3
Re: Matching in .htaccess file
Posted: Tue Mar 03, 2009 5:09 pm
by semlar
pickle wrote:Yes I am using a custom 404 page. That page is just a simple dump that says "file not found". Even when I comment out that line, nothing changes.
Does templates/whatever redirect to templates.php without any of your rewrites?
Re: Matching in .htaccess file
Posted: Tue Mar 03, 2009 5:11 pm
by josh
semlar wrote:Maybe the server is doing it by itself.
Negative, its happening on ubuntu only. It's got to be a stray rewrite from httpd.conf or some plugin. This is not default apache behavior by a long shot!
Re: Matching in .htaccess file
Posted: Tue Mar 03, 2009 5:16 pm
by pickle
Ubuntu has an empty httpd.conf file. I've greped the apache2.conf file and the sites-enabled/000-default file for "php" - nothing found.
Re: Matching in .htaccess file
Posted: Tue Mar 03, 2009 5:21 pm
by josh
Hmm, oddest freakin problems always get to me... The only last thing I'd check is that the .php isnt getting dumped into the access log, if it is then its something before apache. I didn't even know you could have empty httpd.conf files

Re: Matching in .htaccess file
Posted: Tue Mar 03, 2009 5:34 pm
by pickle
I built another virtual host to test this on, as I didn't want to interfere with the project, which is now being tested by users.
Going to the root of that virtual host & requesting /templates/blah/wank/ puts just that string in the access log - no templates.php entry.
Re: Matching in .htaccess file
Posted: Tue Mar 03, 2009 5:59 pm
by semlar
josh wrote:semlar wrote:Maybe the server is doing it by itself.
Negative, its happening on ubuntu only. It's got to be a stray rewrite from httpd.conf or some plugin. This is not default apache behavior by a long shot!
I meant like a module built into ubuntu's apache, I took it out because it wasn't really clear.
You can set it up so apache looks for similarly-named files if the one requested isn't found, I don't remember how though.
Re: Matching in .htaccess file
Posted: Tue Mar 03, 2009 6:42 pm
by VladSun
Turn off Multiviews:
I've read somewhere it's because the order of loading Apache modules in Debian can be wrong (because of these mod-available/mod-enabled bloody directories and file listings): e.g. mod_negotiation is loaded before mod_rewrite. And the processing follows the module load order.
So, another solution to this problem is to set a proper module load order.
Re: Matching in .htaccess file
Posted: Wed Mar 04, 2009 10:07 am
by pickle
I did that in sites-available/default (which is soft linked from sites-enabled/), restarted apache & no change.
Re: Matching in .htaccess file
Posted: Wed Mar 04, 2009 10:12 am
by VladSun
My
default file is like this:
Code: Select all
/etc/apache2/sites-available# cat default
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks -MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
...
You may also try not to load mod_negotiation
Re: Matching in .htaccess file
Posted: Wed Mar 04, 2009 10:36 am
by pickle
Mine looks pretty much the same:
Code: Select all
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks -MultiViews
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks -MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
I've come to the realization that if it requires all this server configuration to make the .htaccess redirection work, then I don't want to rely on the .htaccess . The goal is to make this as drop-in functional as possible. If the user has to configure their virtual hosts, that's not drop-in.
Re: Matching in .htaccess file
Posted: Wed Mar 04, 2009 10:37 am
by VladSun
I think you can use
Options -MuliViews in .htaccess files and per Directory basis.
Syntax: Options [+|-]option [[+|-]option] ...
Context: server config, virtual host, directory, .htaccess
Re: Matching in .htaccess file
Posted: Wed Mar 04, 2009 10:53 am
by pickle
Hot diggity! That did it. Putting "Options -MultiViews" in the .htaccess file fixed the problem.
Of course, doing a search for "apache multiviews" brings up a slew of people with my exact same problem. Thanks ~Vlad (and everyone else)
Re: Matching in .htaccess file
Posted: Wed Mar 04, 2009 11:43 am
by semlar
That is surprisingly hard to find when you don't know what it's called.
Re: Matching in .htaccess file
Posted: Wed Mar 04, 2009 3:22 pm
by VladSun
Just another reason I'd prefer Slackware over "user-friendly-package-super-powered" distributions

But...
Re: Matching in .htaccess file
Posted: Wed Mar 04, 2009 3:26 pm
by pickle
This project was actually developed on SuSE 10 - we're a *sigh* Novell shop.
Deploying it on Ubuntu was just to work out any cross-distro bugs that may occur.