开发者

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

开发者 https://www.devze.com 2023-01-16 11:27 出处:网络
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.

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

精彩评论

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