1

私はeコマースサイトにmod_geoipを使用して、オーストラリアから同じサーバー上の別のストアフロントに顧客をリダイレクトしています。ストアはroot/store /にあり、root /austore/にリダイレクトしてほしい

私はそれを持っているので、基本的な書き換えは問題なく機能しますが、URL構造は同じである必要があります。たとえば、誰かがroot / store / category / product /のリンクをクリックして海外に住んでいる場合、ファイル構造は両方のストアで同じであるため、root / austore / category /product/にリダイレクトする必要があります。現在のように、そのリンクをクリックすると、基本的なroot /austore/だけにリダイレクトされます。

これが現在の書き換えルールです。

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^AU$
RewriteRule ^([^/]+)$ /austore/ [L]

私が編集している.htaccessファイルはstore/ディレクトリにあります。

どんな助けでも大歓迎です。ありがとう!

アラン

4

1 に答える 1

1

試す

#skip processing /store/skin/ directory
RewriteRule ^store/skin/  - [L,NC] 

#if they live overseas i.e not Australia
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} !^AU$
#if someone clicks on a link that is root/store/category/product/ 
RewriteCond %{REQUEST_URI} ^/store(/.*)$ [NC] 
#I want them to be redirected to root/austore/category/product/ 
RewriteRule ^ /austore%1 [L,R]
于 2012-01-26T23:55:18.787 に答える