I really need your help because I can not solve this problem.
I want to use htaccess to achieve the following functions:
Access [
xyz.domain.com...] or [
xyz.domain.com...] the url will be redirected to: /website.php?subdomain=xyz, and the "xyz" can not contain certain strings such as www, admin, email and so on.
Access [
xyz.domain.com...] the url will be redirected to: /category.php?subdomain=xyz&cid=89
Access [
xyz.domain.com...] the url will be redirected to: /document.php?subdomain=xyz&did=1234
I tried the following rules, but only achieved the first step, the second and third steps have failed, please help me.
RewriteCond %{HTTP_HOST} (?!www|shop|bbs|home|pay|account|admin|cms|image|mobile|m|wap)^[a-z0-9\-]+\.domain\.com$
RewriteRule ^/?$ /%{HTTP_HOST}
RewriteRule ^/([a-z0-9\-]+)\.domain\.com/?$ /website.php?subdomain=$1