I have searched and tried all possible suggestions that I have found in the forums / google. I simply can not get Clean URLs to work. I know for a fact mod_rewrite is installed and working here's a simple test I set up:

        <Directory />
                Include /www/whitecourtbgc/.htconf
        </Directory>

.htconf currently contains the following code:

RewriteEngine On
RewriteRule testpage\.html http://www.google.com [R]

This simple test of mod_rewrite works as it is and I get redirected to google. When I copy the contents of the provided Drupal 6.3 .htaccess file the Clean URLs test fails and the "Enable" button is always greyed out. I tried .htaccess, directives in the apache conf file, changing various rewrite variables to no avail. Also, if I change the variable table to enable clean urls I actually get a Drupal response "This page was not found" so I know something is working.

So, I know rewrite is enabled and working. But the clean urls test always fails and I can not enable it. If I hack the db to change the variable I get a drupal response "Page not found", ie the theme etc is processed the page is simply not found by drupal.

Tomorrow I'll enable the rewrite logs and see if I can get more details. But meanwhile any suggestions appreciated.

Comments

khawaja’s picture

I believe the following from the RewriteLog is the problem:

split uri=index.php?q=www/whitecourtbgc/admin -> uri=index.php, args=q=www/whitecourtbgc/admin

The RewriteCond statements turn the args into a filepath. From what I read the result of one RewriteCond statement is fed into the next. Thus, probably something more complex is needed. The following works but the internal args look like ?q=/admin.

RewriteRule ^(.*)$ index.php?q=%{REQUEST_URI} [L,QSA]

I'll look into this more later but to be perfect I'd like the args to look like ?q=admin, even though the above statement works it isn't perfect.

khawaja’s picture

RewriteRule www/whitecourtbgc/(.*)$ \?q=$1 [L,QSA]

RewriteBase has made no difference to my previous errors. The above RewriteRule has fixed my problem ie the Clean URLs test passes and I'm able to "Enable" it from the admin pages instead of having to overwrite the variable in settings.php. As well they actually all work with the internal args being parsed properly to "?q=admin" etc instead of the previous "?q=/admin" etc.

The "www/whitecourtbgc/" part is my RewriteBase / DocumentRoot so you will have to know that or discover it from your logs if you're having a similar problem.