问题
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:
Yes possible, try this rule:
RewriteEngine On RewriteRule . /? [L,R=302]
Since rule is not using
301
SEO may not be impacted.
来源:https://stackoverflow.com/questions/20154805/rewrite-all-urls-to-http-domain-com