如何使用 .htaccess 删除不需要的子域?

发布于 2024-10-03 08:45:13 字数 197 浏览 0 评论 0原文

无论出于何种原因,我客户的网站在 Google 中显示时,其子域中有竞争对手的电话号码。并非所有结果,但现在有几个结果显示了这一点。

那么 www.clientsite.com 应该是 www.800-555-1212www.clientsite.com

我如何设置我的 .htaccess 以保持它与 www.clientsite.com 一样?

For whatever reason, my client's site is showing up in Google with a competitors phone number in the subdomain. Not all results, but several results are showing it now.

So what should be www.clientsite.com is coming up with www.800-555-1212www.clientsite.com

How do I set my .htaccess to keep it just as www.clientsite.com?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

只是我以为 2024-10-10 08:45:13
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.clientsite\.com
RewriteRule .* http://www.clientsite.com/$0 [redirect=permanent,L]
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.clientsite\.com
RewriteRule .* http://www.clientsite.com/$0 [redirect=permanent,L]
生生漫 2024-10-10 08:45:13

我发现这有效

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.clientsite\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9-]+)\.clientsite\.com$ [NC]
RewriteRule .* http://www.clientsite/$0 [redirect=permanent,L]

I've found that this works

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.clientsite\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9-]+)\.clientsite\.com$ [NC]
RewriteRule .* http://www.clientsite/$0 [redirect=permanent,L]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文