繁体   English   中英

htaccess重写未更改浏览器地址栏

[英]htaccess Rewrite is Not Changing Browser Address Bar

我觉得我在这里想念什么。 我们最初使用子域(m.example.com)进行移动流量。 现在,我们希望不再使用它,我们希望将访问m.example.com页面的所有用户直接重定向到example.com。 一切似乎都正常,但是浏览器中的地址栏永远不会改变。 如果用户键入m.example.com,则该域仍保留在地址栏中。 我想念什么? 这是我的htaccess中的重写:

RewriteEngine on
  RewriteRule ^ - [E=protossl]
  RewriteCond %{HTTPS} on
  RewriteRule ^ - [E=protossl:s]

  #custom redirects
  #RewriteCond %{HTTP_HOST} ^example.com
  #RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]

您可以使用:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^m\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=permanent,L]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM