Bug 430385 - clean urls do not work due to inconsistency between drupal.conf and .htaccess file
Summary: clean urls do not work due to inconsistency between drupal.conf and .htaccess...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: drupal
Version: 8
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-01-27 10:02 UTC by Roland Hermans
Modified: 2008-02-26 00:28 UTC (History)
0 users

Fixed In Version: 5.7-1.fc8
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-02-26 00:28:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Roland Hermans 2008-01-27 10:02:09 UTC
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
to /drupal.

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):
drupal-5.6-1.fc8

How reproducible:
always

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
  
Actual results:
page not found

Expected results:
drupal site works with clean urls

Additional info:
bug #427720 fixed the packaging of the .htaccess file

Comment 1 Gwyn Ciesla 2008-02-01 19:14:19 UTC
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?

Comment 2 Roland Hermans 2008-02-02 09:09:21 UTC
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
hosts.

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
possible solutions:
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?

Comment 3 Gwyn Ciesla 2008-02-04 12:55:41 UTC
How about I upgrade to 5.7?

http://drupal.org/node/215269

Looks like this, plus marking .htaccess as noreplace, would do it.  Agreed?

Comment 4 Roland Hermans 2008-02-21 22:21:26 UTC
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 ;-)).

Comment 5 Fedora Update System 2008-02-22 13:25:12 UTC
drupal-5.7-1.fc8 has been submitted as an update for Fedora 8

Comment 6 Gwyn Ciesla 2008-02-22 13:28:59 UTC
Build, bodhi requests for F-8 and F-7.

Starting work on drupal 6.0 for F-9.  Thanks!

Comment 7 Fedora Update System 2008-02-26 00:28:11 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.