Does templates/whatever redirect to templates.php without any of your rewrites?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.
[solved] Matching in .htaccess file
Moderator: General Moderators
Re: Matching in .htaccess file
Re: Matching in .htaccess file
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!semlar wrote:Maybe the server is doing it by itself.
Re: Matching in .htaccess file
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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Matching in .htaccess file
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
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.
Going to the root of that virtual host & requesting /templates/blah/wank/ puts just that string in the access log - no templates.php entry.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Matching in .htaccess file
I meant like a module built into ubuntu's apache, I took it out because it wasn't really clear.josh wrote: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!semlar wrote:Maybe the server is doing it by itself.
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
Turn off Multiviews:
Code: Select all
Options -MultiviewsSo, another solution to this problem is to set a proper module load order.
There are 10 types of people in this world, those who understand binary and those who don't
Re: Matching in .htaccess file
I did that in sites-available/default (which is soft linked from sites-enabled/), restarted apache & no change.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Matching in .htaccess file
My default file is like this:
You may also try not to load mod_negotiation
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>
... There are 10 types of people in this world, those who understand binary and those who don't
Re: Matching in .htaccess file
Mine looks pretty much the same:
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.
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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Matching in .htaccess file
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
There are 10 types of people in this world, those who understand binary and those who don't
Re: Matching in .htaccess file
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)
Of course, doing a search for "apache multiviews" brings up a slew of people with my exact same problem. Thanks ~Vlad (and everyone else)
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Matching in .htaccess file
That is surprisingly hard to find when you don't know what it's called.
Re: Matching in .htaccess file
Just another reason I'd prefer Slackware over "user-friendly-package-super-powered" distributions 
But...
But...
There are 10 types of people in this world, those who understand binary and those who don't
Re: Matching in .htaccess file
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.
Deploying it on Ubuntu was just to work out any cross-distro bugs that may occur.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.