将所有URL重写为http://domain.com [英] Rewrite all URLs to http://domain.com
本文介绍了将所有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?
推荐答案
-
可以,请尝试以下规则:
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屋!
查看全文