Hi,
We have been using these rewrite rules now for nicely formatted URLs for a few months now:
RewriteCond %{REQUEST_URI} !^/(stylesheets|images|skins)/ RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php RewriteCond %{REQUEST_URI} !^/sitemap.xml RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html RewriteCond %{REQUEST_URI} !^/favicon.ico RewriteCond %{REQUEST_URI} !^/robots.txt RewriteRule ^/(.*)$ /index.php/$1 [L,QSA]
But today the RewriteRule stopped working and Apache could no longer find /index.php/Main_Page anymore:
File does not exist: /var/www/html/wiki/index.php/Main_Page
It seems pretty weird, the only thing I can think of is that something changed with our Apache configuration? What usually prevents users from being able to use the /index.php/$1 configuration? What keeps Apache from attempting to recognize index.php as a directory?
I switched it to:
RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA]
And it seems to work, but I'm curious as to why it changed all of a sudden. I couldn't find anything on Google or the meta-wiki, so I thought I'd post it here.
Thanks, Travis
On 5/1/05, Travis Derouin tderouin@gmail.com wrote:
What keeps Apache from attempting to recognize index.php as a directory?
The DirectoryIndex directive tells apache what kind of files it should use for indices. Mine reads:
DirectoryIndex index.html index.html.var index.php
Travis Derouin wrote:
But today the RewriteRule stopped working and Apache could no longer find /index.php/Main_Page anymore:
File does not exist: /var/www/html/wiki/index.php/Main_Page
It seems pretty weird, the only thing I can think of is that something changed with our Apache configuration?
Well, has it? :) Do you run this server yourself, or are you at the mercy of some diabolical sysadmin who changes things without notice? If diabolical sysadmin, ask them what they've changed...
What usually prevents users from being able to use the /index.php/$1 configuration? What keeps Apache from attempting to recognize index.php as a directory?
If PHP's configured as a CGI or FastCGI module, or apache2filter, this type of URL usually returns a 404 Not Found error.
If PHP's configured as apache or apache2handler it should work.
Special:Version will display the server API configuration that your PHP is set up as; you can also make a script that runs the phpinfo() function to dump a lot of configuration information.
-- brion vibber (brion @ pobox.com)
Hi,
Thanks for the reply. It does look like we are using it as a filter.
There doesn't seem to be much documentation on apache2filter vs apache2handler on the PHP site, are there any differences between the two? Is there any benefit to running one over the other?
Thanks, Travis
On 5/1/05, Brion Vibber brion@pobox.com wrote:
Travis Derouin wrote:
But today the RewriteRule stopped working and Apache could no longer
find
/index.php/Main_Page anymore:
File does not exist: /var/www/html/wiki/index.php/Main_Page
It seems pretty weird, the only thing I can think of is that something changed with our Apache configuration?
Well, has it? :) Do you run this server yourself, or are you at the mercy of some diabolical sysadmin who changes things without notice? If diabolical sysadmin, ask them what they've changed...
What usually prevents users from being able to use the /index.php/$1 configuration? What keeps Apache
from
attempting to recognize index.php as a directory?
If PHP's configured as a CGI or FastCGI module, or apache2filter, this type of URL usually returns a 404 Not Found error.
If PHP's configured as apache or apache2handler it should work.
Special:Version will display the server API configuration that your PHP is set up as; you can also make a script that runs the phpinfo() function to dump a lot of configuration information.
-- brion vibber (brion @ pobox.com http://pobox.com)
Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Travis Derouin wrote:
Thanks for the reply. It does look like we are using it as a filter.
There doesn't seem to be much documentation on apache2filter vs apache2handler on the PHP site, are there any differences between the two? Is there any benefit to running one over the other?
Main difference seems to be that apache2filter doesn't work right. :D
There may be some super duper benefit to the 'filter' version but unless you know what that is and really need it, I'd recommend you stick with the handler.
-- brion vibber (brion @ pobox.com)
wikitech-l@lists.wikimedia.org