Bug 430385 - clean urls do not work due to inconsistency between drupal.conf and .htaccess file
clean urls do not work due to inconsistency between drupal.conf and .htaccess...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: drupal (Show other bugs)
8
All Linux
low Severity low
: ---
: ---
Assigned To: Gwyn Ciesla
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-27 05:02 EST by Roland Hermans
Modified: 2008-02-25 19:28 EST (History)
0 users

See Also:
Fixed In Version: 5.7-1.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-25 19:28:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Roland Hermans 2008-01-27 05:02:09 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
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 14:14:19 EST
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 04:09:21 EST
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 07:55:41 EST
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 17:21:26 EST
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 08:25:12 EST
drupal-5.7-1.fc8 has been submitted as an update for Fedora 8
Comment 6 Gwyn Ciesla 2008-02-22 08:28:59 EST
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-25 19:28:11 EST
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.