Goal

  • Since Apache 2.2.16, the core mod_dir module supports the FallbackResource directive, which solves and replaces the 80% use-case of mod_rewrite.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, drupal8.fallbackresource-mod_rewrite-gone.0.patch, failed testing.

effulgentsia’s picture

Awesome! Apache++. This could make #1183208: Remove variable_get('clean_url') and switch to index.php/path pattern for dirty URL support even more palatable by leaving less users needing to deal with dirty URLs in situations where rewrite rules don't work or conflict with other ones.

+++ b/.htaccess
@@ -52,87 +53,3 @@ DirectoryIndex index.php index.html index.htm
-  # Redirect common PHP files to their new locations.
-  RewriteCond %{REQUEST_URI} ^(.*)?/(update.php) [OR]
-  RewriteCond %{REQUEST_URI} ^(.*)?/(install.php) [OR]
-  RewriteCond %{REQUEST_URI} ^(.*)?/(cron.php)
-  RewriteCond %{REQUEST_URI} !core
-  RewriteRule ^ %1/core/%2 [L,QSA,R=301]

So how should we deal with this then?

+++ b/.htaccess
@@ -52,87 +53,3 @@ DirectoryIndex index.php index.html index.htm
-  RewriteCond %{REQUEST_URI} !=/favicon.ico

And this?

+++ b/.htaccess
@@ -52,87 +53,3 @@ DirectoryIndex index.php index.html index.htm
-  # Rules to correctly serve gzip compressed CSS and JS files.
-  # Requires both mod_rewrite and mod_headers to be enabled.
-  <IfModule mod_headers.c>
-    # Serve gzip compressed CSS files if they exist and the client accepts gzip.
-    RewriteCond %{HTTP:Accept-encoding} gzip
-    RewriteCond %{REQUEST_FILENAME}\.gz -s
-    RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
-
-    # Serve gzip compressed JS files if they exist and the client accepts gzip.
-    RewriteCond %{HTTP:Accept-encoding} gzip
-    RewriteCond %{REQUEST_FILENAME}\.gz -s
-    RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
-
-    # Serve correct content types, and prevent mod_deflate double gzip.
-    RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
-    RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]
-
-    <FilesMatch "(\.js\.gz|\.css\.gz)$">
-      # Serve correct encoding type.
-      Header set Content-Encoding gzip
-      # Force proxies to cache gzipped & non-gzipped css/js files separately.
-      Header append Vary Accept-Encoding
-    </FilesMatch>
-  </IfModule>

This probably makes sense to leave as rewrite rule based unless someone has other ideas. All that happens when rewrite rules don't work for this is people get less optimized JS and CSS files.

effulgentsia’s picture

Sadly, Ubuntu 10.04 ships with 2.2.14. I don't know about other common Linux distros. In #1463564: Drupal 8 does not work with PHP 5.3.2 (the version shipped with Ubuntu 10.04 LTS), Dries committed my patch that raised the PHP requirement to above what Ubuntu 10.04 ships with, but it's possible that decision will get reversed before D8 release.

sun’s picture

I suspect that testbots don't run on Apache 2.2.16+.

Puppet config only specifies the package, but no version:
http://drupalcode.org/project/drupaltestbot-puppet.git/blob/refs/heads/m...

Eric_A’s picture

Sadly, Ubuntu 10.04 ships with 2.2.14.

I suspect that testbots don't run on Apache 2.2.16+.

Drupal 8 currently requires PHP 5.3.10 (Ubuntu 12.04) and for creating a testbot one is currently being pointed to Debian Squeeze.

Is the Apache 2.2.16 dependency still a blocker?

NaheemSays’s picture

According to Distrowatch (http://distrowatch.com/table.php?distribution=ubuntu), 12.04 shipped with Apache httpd 2.2.22, so that shouldn't be a problem.

joelpittet’s picture

Issue summary: View changes
Status: Needs work » Closed (duplicate)