2012-01-06 9 views
3

可能であれば、htaccessで次のことを行います。htaccess mod_rewrite特定のフォルダに.tld

ウェブページはこのように動作し、domain.de/de/startと英語版domain.de/en/startでインデックスファイルを取得します。

私は彼の代わりにdomain.de/de/domain.de/en/で終わるしたいユーザーの訪問domain.comもしそうなら、私はdomain.com/xx/something

domain.de/en/のおかげで domain.comではなく、要求にすべての要求を書き換える必要があり。

答えて

3

を使用してみてください:

Options +FollowSymLinks -MultiViews 
RewriteEngine on 

RewriteCond %{HTTP_HOST} ^domain\.com$ 
RewriteRule ^$ http://domain.de/en/ [L,R=301] 
1

、私ははっきりとあなたを理解していればあなただけhttp://domain.de/en/http://domain.com/をリダイレクトしたいが、ませがあなたの.htaccessファイルにこのコードを入れてhttp://domain.com/XX/YY

をリダイレクトしたいんHTTP_HOSTrewritecond

RewriteCond %{HTTP_HOST}=domain.de 
RewriteCond %{REQUEST_URI}=/    % redirect only the root 
RewriteRule ^/$ /de/start [L]    % to /de/start 

RewriteCond %{HTTP_HOST}=domain.de 
RewriteCond !%{REQUEST_URI}=/    % no root 
RewriteCond !%{REQUEST_URI}=/[a-z]{2}/.* % except /xx/ directories 
RewriteRule ^/.*$ /de/$1 [L]    % push the user in the /de/ directory 
関連する問題