开发者

how to htaccess redirect form www.mysite.com/* to www.mysite.com/

On my site google indexed www.mysite.com/* which isn't on my server.

This URL came from some other external source and it's causing a 404 error.

So I开发者_Go百科 want to redirect this URL to my homepage.

How can I achive that?


You could do a 301 redirect to your homepage. Search engines will then learn from this and eventually the listing will be removed.

Redirect 301 old-page.htm index.htm


Add the following value to your .htaccess

ErrorDocument 404 /index.php

Or .html is you're index is a .htm or .html file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜