Skip to content

Instantly share code, notes, and snippets.

@samhernandez
Created January 28, 2015 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samhernandez/12e5fbafb86934b4f8b0 to your computer and use it in GitHub Desktop.
Save samhernandez/12e5fbafb86934b4f8b0 to your computer and use it in GitHub Desktop.
Redirect to files that exist without the first language segment in the url
# For Drupal multilingual sites
#
# When the first segment of the url path is a language like 'en', 'fr', 'es'
# paths to files break because Drupal adds them to the base url.
# This turns `http://site.com/es/style.css` into `http://site.com/style.css`
# if the latter is actually a file.
RewriteCond %{DOCUMENT_ROOT}/$1 -f
RewriteRule ^/?\w{2}/(.+)$ %{DOCUMENT_ROOT}/$1 [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment