This project is read-only.

Rewrite multiple domain for specific language

Jul 9, 2011 at 1:36 PM

Hi All,

I've plan to use orchard rewrite module to handle multi-language site with rule below.


http://domain1/products  ---->  http://domain1/en-Us/products

http://domain2/products ----> http://domain2/fr-FR/product


I've simulate following syntax and it is working correctly

RewriteRule ^(.*)$ /fr-FR/$1

Transfer to /fr-FR/products

I put ReWriteCond %{HTTP_HOST} but system shows runtime error.

RewriteCond %{HTTP_HOST} ^domain2$
RewriteRule ^(.*)$ /fr-FR/$1

Could you please give me suggestion to specify rewrite rule per domain?


Thank you,


Jul 9, 2011 at 5:44 PM

I have fixed this issue in the simulation, if it is what you are referring to, and uploaded a new version of the module.

By the way, the rules you wrote are working fine.

Jul 14, 2011 at 11:00 AM

I want to skip rewriteRule for non-localized url such as login page, dashboard pages for each domain. I add following code to each domain.

# Thailand rule
RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteCond %{REQUEST_URI} !^/th-TH/.*$ [NC]
RewriteCond %{REQUEST_URI} !^/Admin
RewriteCond %{REQUEST_URI} !^/User

RewriteRule ^(.*)$ th-TH/$1 [L]

# Indonesia rule
RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteCond %{REQUEST_URI} !^/id-ID/.*$ [NC]
RewriteCond %{REQUEST_URI} !^/Admin
RewriteCond %{REQUEST_URI} !^/User

RewriteRule ^(.*)$ id-ID/$1 [L]

I've concern about rewrite condition logic below.

  1. Does module impact performance when there are many condition for many country domain?
  2. Do I need duplicate conditional for all language like example above?
  3. Do you have any suggestion for minify numbers of conditions?

Thank you