One of our website has URL like this : example.oursite.com
. We decided to move our site with an URL like this www.oursite.com/example
. To do this,
Seeing as the server will never see the #
(ruling out 301 Redirects) and Google has deprecated their AJAX Crawling scheme, it seems that a front-end solution is the only way!
How I did it:
(function() {
var redirects = [
['#!/about', '/about'],
['#!/contact', '/contact'],
['#!/page-x', '/pageX']
]
for (var i=0; i
I'm assuming that because Google crawlers do indeed execute Javascript, the new pages will be indexed properly.
I've put it in a tag directly underneath the
tag, so that it get executed before any other JS/CSS. Note that this script should only be required for your index file.