开发者

virtual subdomain

开发者 https://www.devze.com 2023-02-03 01:59 出处:网络
i want this: http://100.mydomain.ir--->http://mydomain.ir?option=user&id=100 i try this, but do not开发者_如何转开发 work:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消