这是我的问题:
我想从一个子域重定向用户,同时提供前一个子域的文件。例如,我希望用户访问他们的帐户:
- 文件位于:
holonet.example.com/account/
- 我希望用户的网址指向(显示):
account.example.com/
另一个例子:
- 文件是:
holonet.example.com/account/user/reset
- URL点(显示):
account.example.com/user/reset
我一直在尝试几种 .htaccess 方法,但它们没有奏效。这是我最近的尝试:(publc_html 中的.htaccess):
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(holonet\.)?thearmyoflight\.com$ [NC]
RewriteRule ^(.*)$ /account/$1 [L]
然后我尝试了以下方法,因为以前的方法不起作用 -
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/holonet/account/
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.thearmyoflight\.com$ [NC]
RewriteRule ^(.*)$ /holonet/account/%1/$1 [L]