Duplicate of #2382513: Regression fix: allow Drupal 8 to work without Apache mod_rewrite

On a fresh install, Drupal silently fails when a user tries to login with proper credentials. After further investigation, this was related to the mod_rewrite module not being enabled, resulting in $_POST requests to fail.

It would be helpful if Drupal would automatically check for a working mod_rewrite and prompt the user for action if mod_rewrite can't be found / isn't enabled, s. also #2094985: Drupal 8 install does not warn if Clean Urls are not supported.

Right now, INSTALL.txt lists mod_rewrite as an optional requirement, but given the above mentioned bug, this should be made mandatory. What do you think?

Comments

alexpott’s picture

Issue summary: View changes
Priority: Normal » Major

This is a regression from Drupal 7. Drupal 8 is supposed to work without clean urls - at the moment is looks like is works but it is fundamentally broken. It is not just the user login form that is broken it is all form submissions.

chris_hall_hu_cheng’s picture

I don't see how form submissions can be made to work with clean urls and no mod_rewrite? using ErrorDocument in .htaccess to redirect 404 loses the request body, so no access to the original post data.

Am I missing something?

I can't see a way forward on a standard apache/php setup. It is easy to check, there is nothing in $_POST, nothing available to lower level methods to extract the request body.

I am not an Apache guru, but unless someone can point out the method for making the original post data available this issue is going no-where.

Perhaps a better plan would be to revert back to index.php based urls when there is no rewrite available?

alexpott’s picture

form submissions will work with index.php/ in front of them.

chris_hall_hu_cheng’s picture

@alexpott exactly

index.php urls are not clean though, and bypassing the current ErrorDocument approach. These form clean url rewrite issues are all getting a little confusing.

We can't just insert index.php/ auto-magically in all form actions, but leave clean urls for everything else that leads to horrid complications and mess (doesn't it?).

I am suggesting that a decision needs to be made. Can anyone see a clear way forward (technical) that allows clean urls without rewrite where forms also work? (I can't, but I might be wrong).

If there is no clear technical path then rather than wasting time, a new issue is made to revert things back to how they used to be, no rewrite -> no clean urls, issues like this can be referenced and closed, we stop kidding ourselves that we will have an elegant working solution with clean urls when rewrite is enabled.

ErrorDocument (the mechanism that is being employed to make clean urls mostly work without rewrite in D8) was never envisaged (I believe) by Apache to pass on post data, it makes sense to allow configuration for custom pages to handle error conditions, it wasn't designed to allow frameworks to implement clean urls without rewrite.

chris_hall_hu_cheng’s picture

I may have a solution to the more general problem of form posts not working full stop here #2382513

yesct’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)