Linux 正在将子域重定向到.htaccess中的父域
我有一个需要重定向到父域的子域列表,但不确定如何在.htaccess中设置重定向 我将如何重定向:Linux 正在将子域重定向到.htaccess中的父域,linux,.htaccess,Linux,.htaccess,我有一个需要重定向到父域的子域列表,但不确定如何在.htaccess中设置重定向 我将如何重定向: 到 在我的.htaccess中 重定向 到 将以下规则添加到htaccess: RewriteEngine on RewriteCond %{HTTP_HOST} ^subdomain\.example\.com$ RewriteRule ^/?somepage http://example.com%{REQUEST_URI} [NE,NC,R,L] 转到你的子域文件夹 在
- 在我的.htaccess中
- 重定向
RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain\.example\.com$
RewriteRule ^/?somepage http://example.com%{REQUEST_URI} [NE,NC,R,L]
Redirect 301 /login http://example.com/somepage
我必须设置子域才能工作吗?这种方法可以工作,但不会重定向到正确的页面:RewriteCond%{HTTP\u HOST}^tips\.silvercross\.com$[或]RewriteCond%{HTTP\u HOST}^www.tips\.silvercross\.com$RewriteRule^/?$“https\:\/\/\/www.silvercross\.com\/”[R=301,L]