Rewrite all URLs to http://domain.com

2019-09-19 10:27发布

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

E.g.:

  • 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) If it is possible, how would this effect SEO and page rankings?

1条回答
啃猪蹄的小仙女
2楼-- · 2019-09-19 10:41
  1. Yes possible, try this rule:

    RewriteEngine On
    RewriteRule . /? [L,R=302]
    
  2. Since rule is not using 301 SEO may not be impacted.

查看更多
登录 后发表回答