0
我得到了apache2與mod_rewrite,我也有訪問.htaccess的網站。重定向子域沒有改變URL
我希望URL profile.domain.com/username
重定向到www.domain.com/profiles/php?user=username
但保持URL爲profile.domain.com/username
。我已經有一個通配符設置來捕獲所有子域。我試圖使用方法:
RewriteCond %{HTTP_HOST} ^profile\.domain\.com$ [NC]
RewriteRule ^(.+)$ http://www.domain.com/profiles/php?user=%1 [R=301,L]
但它改變了網址和總是擦肩而過,用戶名。另外,我不希望它更改我希望它保留的網址profile.domain.com/username
我有一些東西simmilar這種不使用不同的子域,但我得到'請求超過了10個內部重定向的上限,由於可能的配置錯誤。如果需要,使用'LimitInternalRecursion'來增加限制。使用'LogLevel debug'來獲得回溯.' – ParoX
想通了,只需要添加額外的RewriteCond%{REQUEST_URI}![phpfilename] $ – ParoX