I'm trying to have the homepage of a website automatically load at a specific <div>
ID (i.e. www.thesite.com/#bottom
), so that there will be content to scroll upwards to.
I tried setting a 301 redirect or use mod.rewrite
via .htaccess
, but that resulted in too many redirects since it goes to the same page.
Adding some code to the body tag <body onload="window.location.hash = 'bottom'">
works out but it briefly displays the top of the page so there is a sort of delay and bounce that I'm hoping to avoid.
If anyone has a solution to this using .htaccess
or JavaScript that they could suggest I would really appreciate it.