私は .htaccess にこのコードを持っています:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.(css|gif|ico|jpg|js|png|swf|txt)$
# If empty subdomain, replace with "www"
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule ^(.*) http://www.example.com/$1 [QSA,L,R=301]
# If subdomain isn't empty and not "www", redirect to "folder"
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteCond %{HTTP_HOST} ^(.*)\.example\.com$
RewriteRule (.*) http://www.example.com/%1/$1 [QSA,R=301]
#PAGES REDIRECTION
RewriteRule ^(.*)/register/ /index.php?sub=$1&page=register
RewriteRule ^(.*)/register /index.php?sub=$1&page=register
RewriteRule ^(.*)/lostpass/ /index.php?sub=$1&page=lostpass
RewriteRule ^(.*)/lostpass /index.php?sub=$1&page=lostpass
...
(ワイルドカード サブドメインのルールは既に導入され、機能しています)
http://test.example.comを参照すると、 http://www.example.com/testに正しくリダイレクトされますが、 http://test.example.com/registerを参照しようとすると、実際にはリダイレクトされますhttp://www.example.com/test/index.php?sub=http://www.example.com/test&page=registerにリダイレクトし、 http://www.example.com/test/registerにリダイレクトする必要があります
ここで何が間違っていますか?前もって感謝します!