0
如何我也可以把所有子域名沒有改變URL重定向所有的子域,發送請求文件獲得
ASLO發送子域和請求文件與GET方法index.php文件, 與htaccess的 例如
http://testsubdomain.mysite.ir/test.php
重定向到
http://mysite.ir/users/index.php?domain=testsubdomain&file=test.php
如何我也可以把所有子域名沒有改變URL重定向所有的子域,發送請求文件獲得
ASLO發送子域和請求文件與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
它的工作只爲testsubdomain,我要爲每個子域的請求 – Cooper
你檢查的文檔工作?看看'RewriteCond'。 – fbitterlich
是的,但我不知道我有這樣的代碼 RewriteEngine敘述上 RewriteBase/ 的RewriteCond%{HTTP_HOST} ^(。*)\。mysite的\ .IR [NC] 重寫規則^ * $的index.php?域= %1&name = [L] 它的工作,但我不知道如何也得到文件請求 – Cooper