The following message appears regardless of setting in .htaccess and setting.php. "It appears your host is not configured correctly for Clean URLs. Please check for ModRewrite support with your administrator."

This feature works in a 4.5 drupal installation but not in 4.6.6 or 4.7. I see some work is being done in 4.7 to correct this but I see this as a regression that should be patched asap.

I suspect that the problem is in system.module around line 555 which states:

if ($edit['clean_url'] && !variable_get('clean_url_ok', 0)) {
drupal_set_message(t('It appears your host is not configured correctly for Clean URLs. Please check for ModRewrite support with your administrator.'), 'error');
$edit['clean_url'] = 0;

If my reading is correct, $edit is not the place for this test. I would also expect that a GET or other function should strip the =q before testing.

Comments

greggles’s picture

I don't know whether or not there is a problem with that test, or not. What I do know is that I am using 4.6.6 and could not repeat the bug as filed.

I believe there are some other issues at play here which are affecting grsingleton's system, but not systems in general (as this would upset a lot of people if it didn't work)

Steps to attempt to repeat:
1. have drupal 4.6.6 installed
2. enable clean urls

Expected Results:
See the message:
"It appears your host is not configured correctly for Clean URLs. Please check for ModRewrite support with your administrator."

At the top of the settings.php page

Actual Results:
Clean URLS applied correctly and I get the message "The configuration options have been saved."

I'm using PHP5.1.x, Apache2.0.x, Drupal4.6.6 (both upgraded from 4.6.x and fresh installs)

grsingleton’s picture

Try this on debian with Apache 1.3, php 4.3. I know about php5 and Apapche2. This latter setup is not the problem. Debian stable does not have php5 or Apache2 available. So we are stuck. Worksforme in another environment is not helpful but interesting.

Zen’s picture

Priority: Critical » Normal

Works fine for me in Suse and FC2. Downgrading.

-K

el56’s picture

I'm running into a similar problem.

In the process of doing an upgrade from 4.5 to 4.6, we've created a separate apache virtual server, with its own drupal root directory, so that we can test the upgrade while the existing 4.5-based site stays live. The environment is a Debian system with PHP4 and Apache1.

I know the Apache setup is working since clean urls work fine under our live 4.5 system. It's just that I can't seem to make it work for the 4.6 test installatio. I get the same error message "It appears your host is not configured correctly for Clean URLs. Please check for ModRewrite support with your administrator." anytime I try to enable the feature.

Is the setup such that the Apache config for clean urls in 4.5 is different from the one in 4.6, and that I have to choose one or the other? Or is there something else that might be at cause? Any pointers you can offer would be appreciated.

webchick’s picture

Category: bug » support

Since this is not a universal thing (at least a few people can in fact get Clean URLs working in 4.6.6), changing status to a support request -- it is likely due to a server config issue. Maybe this page could help? http://drupal.org/node/15365

grsingleton’s picture

I have looked at the reference and it gives me the idea that clean URL is posisble. Nonetheless, lcannot get it to work. No doubt my own fault. What I would like, if possible, is some better examples. It works with 4.5 but not with 4.6.6 on the same machine so I will agree there is a config problem. I have the same problem on a different machine with apache2 and drupal4.6.5.
So I have to ask, where does one stuff AllowOverride? I have fixed my .htaccess file in both cases to include the '/' before index in the rewrite section. I have set Base to point directly to the directory where the non-working drupal lives on both machines. e.g.
RewriteBase /drupal on the apache2 box and similar for the apache1.3 box.

mod_rewrite is loaded and active in both cases.

Please give examples from a working system as I just to not get it.

grsingleton’s picture

I finally got it!

You put AllowOverride into the apache config for your server. here is an example:

ServerAdmin webmaster@example.com
# DocumentRoot /home/example/http
DocumentRoot /home/example/drupal
Options +FollowSymLinks +Includes
ServerName old.example.com
ServerAlias www.old.example.com
ErrorLog /var/log/apache/old.lexample.com-error.log
CustomLog /var/log/apache/old.example.com-access.log common

AllowOverride All

Next fix up the .htaccess in /home/example as follows:


RewriteEngine on

# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
#RewriteBase /
RewriteBase /home/example/drupal

# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]

# Rewrite old-style URLs of the form 'module.php?mod=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
#RewriteRule module.php index.php?q=%1 [L]

# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# RewriteCond %{REQUEST_FILENAME} !^index.php
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

NOTE: the change to the last rule above. Without it you get the results I reported.

Lastly reload your http server.

Please close this issue.

heine’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)