Regression fix: allow Drupal 8 to work without Apache mod_rewrite

Created on 26 November 2014, over 9 years ago
Updated 12 September 2023, 10 months ago

Beta phase evaluation

<!--Uncomment the relevant rows for the issue. -->

Problem/Motivation

If you install Drupal on Apache without rewrite enabled then you are left with a site that appears to work but can't receive form submissions. There are no warnings during install and no error messages, to the uninformed user form submissions (logging in, creating content, changing configuration etc. are just ignored.).

Clean urls appear to work, thanks to ErrorDocument in .htaccess forward 404 to index.php however this does not provide a mechanism to capture post data in the original request body.

Urls can be manually changed to include index.php/ however you would have to know this technique to move to non-clean urls, also Drupal 8 currently does not even work fully with non-clean urls (some links such as home link etc. lose the index.php/) (should be considered as a separate issue. Note also thate index.php/ urls will not work if Drupal is installed in a sub-directory.

Many people are falling foul of this problem even an experience user may forget to enable rewrite or not realise that some Linux distributions (Ubuntu 14.04 included, do not have it enabled by default).

The motivation for this issue is to provide a simple focused solution that ensures that if a user installs Drupal 8 using Apache without rewrite enabled it just works. The solution should not make anything else worse but neither should it be confused with any clean url, warning, messaging or installation issues.

If it is not possible to fix this then either Rewrite becomes a Requirement (unblocking warnings/errors to be generated on install) or support for dirty urls has to be re-introduced.

Thanks also to @speely for finding the same problem: #2099311: User login not working if mod_rewrite is not enabled β†’

Suggested commit message

git commit -m 'Issue #2382513 by chris_hall_hu_cheng, mikeker, joachim, quietone, shivanshuag, YesCT, Jeroen, joris_lucius, katy5289, sivaji@knackforge.com:: Regression fix: allow Drupal 8 to work without Apache mod_rewrite.'

Proposed resolution

The simplest solution (and the only one I can visualise working at the moment) is to use the Apache FallbackResource directive (appears to be designed for just this purpose and does not rely on rewrite).

Note: Fallback resource raises the requirement for Apache to 2.2.16 see https://www.drupal.org/node/2382513#comment-9379857 β†’

Remaining tasks

User interface changes

None.

API changes

None.

πŸ› Bug report
Status

Fixed

Version

8.1 ⚰️

Component
RoutingΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¬πŸ‡§United Kingdom chris_hall_hu_cheng

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024