且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通配符子域和子文件夹在.htaccess参数

更新时间:2022-11-04 17:51:36

你错过了一个 QSA 标记,因为 L =类型丢失,否则。你的其他规则之前,你只需要一个管理员的规则:

You're missing a QSA flag, as the l=genres gets lost otherwise. You just need an "admin" rule before your other rule:

RewriteEngine on

RewriteCond %{HTTP_HOST} !^www\.mysite.com
RewriteCond %{HTTP_HOST} ^(.+).mysite.com
RewriteRule ^admin/?$ http://www.mysite.com/app/admin.php?dj=%1 [P,L,QSA]

RewriteCond %{HTTP_HOST} !^www\.mysite.com
RewriteCond %{HTTP_HOST} ^(.+).mysite.com
RewriteRule ^([^/]*)$ http://www.mysite.com/app/dj=%1 [P,L,QSA]