Red Hat Bugzilla – Bug 430385
clean urls do not work due to inconsistency between drupal.conf and .htaccess file
Last modified: 2008-02-25 19:28:14 EST
Description of problem:
The clean urls setting of Drupal does not work out of the box with the Fedora
package. The rewrite rules in /usr/share/drupal/.htaccess assume the base URL of
the drupal site to be / but in /etc/httpd/conf.d/drupal.conf the base URL is set
The solution to this problem is to uncomment the "RewriteBase /drupal" line in
/usr/share/drupal/.htaccess. Is it possible to make this the default?
Furthermore it may be helpful to add a comment in the drupal.conf file that
/usr/share/drupal/.htaccess must be updated as well when changing the alias.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. install drupal-5.6 RPM package
2. setup and configure drupal
3. test clean urls via http://localhost/drupal/?q=admin/settings/clean-urls
page not found
drupal site works with clean urls
bug #427720 fixed the packaging of the .htaccess file
Will doing this and pushing it down break any existing sites?
/usr/share/drupal/.htaccess isn't marked noreplace, and maybe it should be, but
what would the ramifications by of having that option set that way on a site not
using it, such as in a name-based virtual host, where drupal is the root, say
http://foobar.org/, as opposed to http://foobar.org/drupal? If there's no
effect, I'm willing to mark it noreplace, make the change, and make notes in the
drupal.conf and the spec. I'd just prefer to make sure that any deviations from
upstream have as few side effects as possible.
As an alternative, I can at least mark it noreplace, so your personal change
wouldn't be wiped out each upgrade. can you test the above and let me know?
Enabling "RewriteBase /drupal" in the .htaccess file has an effect on name-based
virtual hosts with clean urls enabled. After enabling clean urls the urls have
/drupal added to the url, e.g. http://foobar.org/admin/settings becomes
http://foobar.org/drupal/admin/settings, and a user will have to login twice.
Conclusion: it's not wise to enable "RewriteBase /drupal" on name-based virtual
The next thing I tried was moving the RewriteBase line to
/etc/httpd/conf.d/drupal.conf file but without success as it seems to be
overrided by the settings in .htaccess.
It seems to me that on the one hand there is a Fedora policy not to put the web
applications such as MediaWiki, phpMyAdmin and Drupal in the document root and
on the other hand to make as little deviations from upstream as possible and
somehow we'll have to find the right balance between these two. I see two
1. Don't change .htaccess and document in drupal-README.fedora how to enable
clean URLs on a default installation.
2. Set RewriteBase to /drupal in .htaccess and document in drupal-README.fedora
how to enable clean URLS for a name-based virtual host.
Make a choice between these solutions based on the expected usage.
In either case it would be nice to mark .htaccess as noreplace. Does this also
mean it will have to move to /etc/drupal and symlinked since essentially it
becomes a configuration file then?
How about I upgrade to 5.7?
Looks like this, plus marking .htaccess as noreplace, would do it. Agreed?
Sorry for not responding earlier but I lost this bug on my 'radar'.
Your proposal looks OK to me (better to include 6.x in Fedora 9 ;-)).
drupal-5.7-1.fc8 has been submitted as an update for Fedora 8
Build, bodhi requests for F-8 and F-7.
Starting work on drupal 6.0 for F-9. Thanks!
drupal-5.7-1.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.