Return to Snippet

Revision: 12627
at March 21, 2009 21:58 by zachharkey


Updated Code
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /sites/%{HTTP_HOST}/files/$1 [L]

Revision: 12626
at March 21, 2009 21:55 by zachharkey


Initial Code
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /sites/%{HTTP_HOST}/files/$1 [L]

Initial URL
http://drupal.org/node/53705

Initial Description
My [original post](http://drupal.org/node/84895) languished for years before someone pointed out a possible solution [here](http://drupal.org/node/53705).

The following user-submitted code may be useful in redirecting URLs for the /files directory to the /sites/example.com/files directory. The following code is added to the [drupal_root]/files/.htaccess file. **Note, this directory is not part of the default Drupal distribution and must be added.**

Initial Title
Rewrite Drupal's File system paths to remove redundant sites/example.com

Initial Tags
htaccess, drupal

Initial Language
Apache