我有subdomain test.mydomain.com,主应用程序正在test.mydomain.com上运行。
当用户访问http://test.mydomain.com/portal
时,我需要重定向到/users/test/cp
子目录,而无需更改url
我已经写了htaccess,但是CSS和javascript没有加载,显示302响应
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ([^\.]+).mydomain.* [NC]
RewriteRule ^/?portal/(.*)$ /users/%1/cp/$2 [L]
答案 0 :(得分:0)
我找到了答案,我犯了个小错误。
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ([^\.]+).mydomain.* [NC]
RewriteRule ^/?portal/(.*)$ /users/%1/cp/$1 [L]