URLを変更せずにすべてのサブドメインをリダイレクトする方法
サブドメインを送信し、GETメソッドを使用してファイルを index.php ファイルに送信します。たとえば、.htaccess を使用します。
http://testsubdomain.mysite.ir/test.php
にリダイレクト
http://mysite.ir/users/index.php?domain=testsubdomain&file=test.php
URLを変更せずにすべてのサブドメインをリダイレクトする方法
サブドメインを送信し、GETメソッドを使用してファイルを index.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