Can this module work with the Locale core module for international sites?
For example: To have www.mysite.com and mysite.com be the english, and es.mysite.com be the spanish one

Comments

setvik’s picture

To make subdomain work with Locale, you'll need to make a small tweak.

After you've installed Subdomain and applied the included patches (see readme.txt), you'll need to modify one of the RewriteCond statements in your .htaccess file.

The included htaccess patch inserts the following near the bottom of your .htaccess file

  # REQUIRED BY SUBDOMAIN.MODULE
  # Moves subdomain to URI path
  # e.g: mysubdomain.example.com 
  # becomes example.com/index.php?_mysubdomain/
  # NOTE: does not rewrite subdomain if it is "www". 
  # If you want it to rewrite www, disable the 2nd line
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{HTTP_HOST} !^www\.([^.]+)\.([^.]+)$
  RewriteCond %{HTTP_HOST} ^([^.]+)\.([^.]+)\.([^.]+)$
  RewriteRule ^(.*)$ index.php?q=~%1/$1 [L,QSA]

Edit the 2nd RewriteCond statement to prevent Apache from rewriting subdomains for installed locales.

e.g. If you want to support Spanish, you'd change that 2nd RewriteCond to:

  RewriteCond %{HTTP_HOST} !^(www|es)\.([^.]+)\.([^.]+)$

If you want to support Spanish and French, you'd change it to:

  RewriteCond %{HTTP_HOST} !^(www|es|fr)\.([^.]+)\.([^.]+)$

Hope that helps.

setvik’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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