1
我想有http://pk.domain.com被重定向到http://www.domain.com/home.php?country=pk,同樣http://www.domain.com/pk/到http://www.domain.com/home.php?country=pk重定向子域到一個特定的頁面
Options +FollowSymLinks
RewriteEngine on
RewriteBase/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule^- [L]
RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.domain\.com$ [NC]
RewriteRule ^([^/]+)/?$ adlisting.php?country=%1&category=$1 [L,QSA]
RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.domain\.com$ [NC]
RewriteRule ^([^/]+)/([^/]+)/?$ adlisting.php?country=%1&location=$1&category=$2 [L,QSA]
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^([a-z]{2})/([^/]+)/?$ adlisting.php?country=$1&category=$2 [L,QSA,NC]
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^([a-z]{2})/([^/]+)/([^/]+)/?$ adlisting.php?country=$1&location=$2&category=$3 [L,QSA,NC]
這個問題是與Multi-Country Using .htacces
感謝您的及時回覆。你是最棒的! – 2015-03-02 09:47:00
你很受歡迎,很高興它解決了。 – anubhava 2015-03-02 09:48:31