如何在不更改URL的情况下重定向所有子域
同时发送子域并使用GET方法请求文件来索引.php文件,使用 .htaccess例如
http://testsubdomain.mysite.ir/test.php
重定向至
http://mysite.ir/users/index.php?domain=testsubdomain&file=test.php
使用mod_rewrite。例:
RewriteEngine On
RewriteBase /testsubdomain/
RewriteRule ^(.*)'.php$ http://mysite.ir/users/index.php?domain=testsubdomain&file=$1.php
详情请见:http://httpd.apache.org/docs/current/mod/mod_rewrite.html