我使用.htaccess友好的URL,但我有一個問題。我的子域store.domain.com重定向到「/」但默認文件是「store.php」,domain.com重定向到「/」,默認文件是「index.php」如何使用,如果在.htaccess
我需要使用if,for示例
<If host == 'store.domain.com'>
store rewrite rules
<If host == 'domain.com'>
other rewrite rules different of store
</if>
我如何在.htaccess中?
我的.htaccess:
IndexIgnore *
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
RewriteRule ^([a-zA-Z0-9_-]+)$ store.php?page=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ store.php?page=$1
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?page=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?page=$1
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php?page=$1&action=$2
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ index.php?page=$1&action=$2
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ store.php?page=$1&action=$2
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ store.php?page=$1&action=$2