Spin-off from #1183208: Remove variable_get('clean_url') and switch to index.php/path pattern for dirty URL support

Problem

  • When visiting http://example.com on a site where clean URLs are not supported, but index.php is found as default document, then all links will use clean URLs, which won't work.
  • install.php and update.php output links to index.php, which always assume and use clean URLs, which may not be supported.

Details

Proposed resolution

- TBD -

Related issues

Comments

effulgentsia’s picture

Note that that patch uses a $script_path global variable that by default is auto-determined, just like $base_url. So, both of the above use-cases could be solved by instructing people running production sites where clean URLs don't work to explicitly set that variable (in settings.php) to 'index.php/', just like we currently have instructions for explicitly setting $base_url on sites where the auto-determination doesn't yield the desired results.

However, I think we can come up with better solutions to this, such as .htaccess and web.config modifications to redirect http://example.com to http://example.com/index.php when the server requirements for the rewrite directives aren't met, and maybe even renaming index.php to drupal.php (to prevent it from being a default document), and add an index.html default document that redirects to drupal.php.

cosmicdreams’s picture

You know....

renaming index.php to drupal.php has another benefit if you think about the future where other apps based on symfony will want to integrate with Drupal tightly.

if you have two apps working with the same symfony backend... how do you get the requests to the proper application? We have HttpKernel in place and that's a major win, but how do you define the routes so that requests get to their proper destination.

If we have one app use index.php and the other use drupal.php you can simply write a .htaccess rule to redirect request to the proper code.

So, in short, +1 for renaming index.php

sun’s picture

Issue summary: View changes

Updated issue summary.

sun’s picture

I've entirely rewritten the issue summary.

Renaming index.php as suggested in #2 seems out of scope for this issue to me, and would make the Drupal setup on special environments (only supporting the default document via DirectoryIndex) even harder.

I'm not sure I understand why we cannot perform a similarly automated clean URL check during the installer, like we previously did on the clean URL setting page (but simplified, and defaulting to clean URLs being enabled if it fails).

sun’s picture

Issue summary: View changes

Updated issue summary.

andypost’s picture

Is TBD valid still? Would be nice to allow to rename index.php

joelpittet’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

Since this is resolved #2382513: Regression fix: allow Drupal 8 to work without Apache mod_rewrite is this issue still relevant or can we close it?

Crell’s picture

Status: Postponed (maintainer needs more info) » Fixed

Given the age of this issue, I'd consider any other tweaking we find we need to do around clean URLs to be a new issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.