Rewrite all URLs to http://domain.com

浪子不回头ぞ 提交于 2019-12-13 08:56:03

问题


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:


  1. Yes possible, try this rule:

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



来源:https://stackoverflow.com/questions/20154805/rewrite-all-urls-to-http-domain-com

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!