virtual subdomain
i want this:
http://100.mydomain.ir ---> http://mydomain.ir?option=user&id=100
i try this, but do not开发者_如何转开发 work:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} !^(www|mail).mydomain.ir$ [NC]
RewriteCond %{HTTP_HOST} !^(www|mail).mydomain.ir$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9-]+).mydomain.ir$ [NC]
RewriteRule ^(.*)/$ ?option=user&id=%2 [R=301,L]
what is my correct .htaccess code?
Use mod_rewrite to achieve this.
精彩评论