问题
I have a website I've designed for a client here: http://www.haniabyanyacole.com
I'm using a meta http-equiv="refresh" to redirect the user from the splash page to haniabyanyacole.com/site/ (I know that's not recommended) and I think this is causing Google to return the first search result for the company's name with http://haniabyanyacole.com/site instead of the root directory.
Is there a redirect solution (301, 302?) that will force Google to index the root instead of /site/? FYI I have uploaded a sitemap to Google Webmaster Tools that includes haniabyanyacole.com/
回答1:
Instead of using a META HTTP-EQUIV, which google equates to a redirect response header, you can try using javascript to do the redirect for you, on a delay. Maybe something like:
<script type="text/javascript">
<!--
function redirect_to_site(){
window.location = "http://haniabyanyacole.com/site"
}
//-->
</script>
in your page header, then in the body tag add:
onLoad="setTimeout('redirect_to_site()', 10000)"
so that it looks something like:
<body onLoad="setTimeout('redirect_to_site()', 10000)" >
This will redirect to http://haniabyanyacole.com/site after 10 seconds.
来源:https://stackoverflow.com/questions/12695925/redirects-google-indexing