English 中文(简体)
Apache 2 Upgrade Killed Our .htaccess, Can t fix, please help!
原标题:

We were forced to upgrade to Apache 2 today and as soon as we did our rule set that was working for months stopped working.

The behavior it shows is completely ignoring the .htacess, even after we delete it (.htacess) the server seems to use a "phantom" rule.

IE: site/stuff/ without .htacess should show a 404... but instead it goes to site/stuff.php (no .htacess at all!)

With .htacess enabled site/stuff/1/ should go to site/stuff.php?var=1 instead it goes to site/stuff.php

Any help appreciated, it s driving us crazy.

问题回答

I m going to guess it s an Apache configuration problem.

Your main httpd.conf has likely set a default for the AllowOverride directive, to None. This is a restrictive set of permissions that improves performance and security, but it means that Apache completely ignores any .htaccess files.

You need to enable AllowOverride for your serving directory, either in the main Apache config file or inside the VirtualHost directive. You can do this by specifying

AllowOverride All

inside your <VirtualHost> or <Directory> block.

EDIT (in response to comments)

Without more information, it will be pretty difficult to diagnose. If you can provide some more details, it would probably help. It does seem that your URLs are being rewritten, so you can try enabling mod_rewrite debugging to see how the rules are getting applied:

<IfModule mod_rewrite.c>
    RewriteLog "/path/to/rewrite.log"
    RewriteLogLevel 3
</IfModule>

2nd Edit - MultiViews

After re-reading the description of your problem, I think you might have an issue with MultiViews. It sounds very similar to this thread I found. Try disabling MultiViews under your <VirtualHost> or <Directory>, they re probably mucking with your rewrite rules.





相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签