将所有URL重写为http://domain.com [英] Rewrite all URLs to http://domain.com

查看:74
本文介绍了将所有URL重写为http://domain.com的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1) .htaccess 是否可以将您的所有URL重写为http://example.com?

1) Is it possible with .htaccess to rewrite all of your URLs to just http://example.com?

例如:

  • http://example.com/folder/subfolder/file.php-> http://example.com
  • http://example.com/index.php-> http://example.com
  • http://example.com/folder/file.php?foo=bar&baz=qux-> http://example.com
  • http://example.com/folder/subfolder/file.php -> http://example.com
  • http://example.com/index.php -> http://example.com
  • http://example.com/folder/file.php?foo=bar&baz=qux -> http://example.com

2)如果可能,这将如何影响SEO和页面排名?

2) If it is possible, how would this effect SEO and page rankings?

推荐答案

  1. 可以,请尝试以下规则:

  1. Yes possible, try this rule:

RewriteEngine On
RewriteRule . /? [L,R=302]

  • 由于未使用规则301 SEO可能不会受到影响.

  • Since rule is not using 301 SEO may not be impacted.

    这篇关于将所有URL重写为http://domain.com的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆