[英]How to keep sub domain url instead of main domain url using htaccess?
I want to redirect to main domain from a sub domain, keeping the sub domain in the address bar using htaccess. 我想从子域重定向到主域,使用htaccess将子域保留在地址栏中。 I tried the following code
我尝试了以下代码
RewriteEngine On
RewriteCond %{HTTP_HOST} ^advertiser\.(xxxx\.com)$ [NC]
RewriteRule ^dashboard/?$ http://www.xxxx.com/en/index.php/publisher/dashboardadvtsr [L,NC,R=301]
By using this code, when we write 'advertiser.xxxx.com' in the address bar it redirect to the link ' http://www.xxxx.com/en/index.php/publisher/dashboardadvtsr '. 通过使用此代码,当我们在地址栏中写入“ advertiser.xxxx.com”时,它将重定向到链接“ http://www.xxxx.com/en/index.php/publisher/dashboardadvtsr ”。 I want to keep 'advertiser.xxxx.com' in address bar.
我想在地址栏中保留“ advertiser.xxxx.com”。 How can I do this using htaccess?
如何使用htaccess做到这一点?
Since both domains are in public_html you can use this rule: 由于两个域都位于public_html中,因此您可以使用以下规则:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^advertiser\.xxxx\.com$ [NC]
RewriteRule ^dashboard/?$ /en/index.php/publisher/dashboardadvtsr [L,NC]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.