I have a multi-subdomain multi-lingual website setup and I need to redirect a language subfolder of a certain domain. eg. au.domain.com/us/request_uri to au.domain.com/en/request_uri. This rule needs to be ignored on other domains. All domains are run off the same codebase and all use the one htaccess file (drupal install with domain access module). This shouldn't affect how the htaccess rule is set though.

没有正确的解决方案

其他提示

Here is one way to do it:

RewriteEngine On
RewriteRule ^us/(.*)$ http://au.domain.com/en/$1 [L,R=301]

Redirects:

http://au.domain.com/us/anything to

http://au.domain.com/en/anything/

UPDATED

RewriteEngine On
RewriteRule http://au.domain.com/us/^(.*)$ http://au.domain.com/en/$1 [L,R=301]

Only http://au.domain.com/us/anything will be redirected to

http://au.domain.com/en/anything/

OR

RewriteEngine On
RewriteCond %{HTTP_HOST} ^au.domain\.com$ [NC]
RewriteRule ^us/(.*)$ http://au.domain.com/en/$1 [L,R=301]

Hope this helps.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top