3

可能であれば、htaccessで次のことをしたいと思います。

Webページはこのように機能し、インデックスファイルはを介して取得しdomain.de/de/start、英語版はを介して取得しますdomain.de/en/start

ユーザーがdomain.comdomain.de/en/にアクセスした場合、代わりにユーザーにアクセスしてもらいたいので、 domain.comdomain.de/de/へのすべてのリクエストを書き換える必要がありますが、domain.com/xx/somethingdomain.de/en/

ありがとう。

4

2 に答える 2

3

私があなたをはっきりと理解しているなら、あなたはリダイレクトしたいだけで、http://domain.com/リダイレクトしhttp://domain.de/en/たくないhttp://domain.com/XX/YY

このコードを.htaccessに入れてください:

Options +FollowSymLinks -MultiViews
RewriteEngine on

RewriteCond %{HTTP_HOST} ^domain\.com$
RewriteRule ^$ http://domain.de/en/ [L,R=301]
于 2012-01-06T15:02:47.563 に答える
1

HTTP_HOST使用してみてくださいrewritecond

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
于 2012-01-06T14:51:23.657 に答える