我想重定向面板内的子域,子域editor.domain.com
它应该重定向到domain.com/cmseditor
。
但是访客应该看到editor.domain.com
。
到目前为止,我已经尝试过:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^editor\.homecatering\.pt$ [NC]
RewriteRule ^ http://homecatering.pt/cmseditor%{REQUEST_URI} [L,R=301]
尝试这样的事情:
RewriteEngine On
# If the subdomain is "editor.homecatering.pt"
RewriteCond %{HTTP_HOST} ^editor.homecatering.pt$ [NC]
# Then rewrite any request to directory /cmseditor
RewriteRule ^((?!cmseditor).*)$ /cmseditor/$1 [NC,L]
或
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^([^\.]+)\.homecatering\.pt$ [NC]
RewriteRule ^(.*)$ http://homecatering\.pt/cmseditor/%1