Forum Moderators: open
www.mysite.com
www.mysite.providername.com (like a subdomain of the provider)
My problem is that 99.9% of my customers are through various CPC marketplaces. My product feeds are automatically uploaded via my ecommerce provider. Hence, everyone who comes off a marketplace is brought to www.mysite.providername.com/somepage.
For obvious reasons (SE ranking, bookmarks, professional looks, etc.) I am looking for an external Scirpt that will redirect the customer from:
www.mysite.providername.com/somepage
to
www.mydomain.com/somepage
on landing without them really noticing and without being penalized by SE's. And only if the providername is in the url.
In other words, the url would be exactly the same (whatever it is) without the providername.
I am a novice webamster and really appreciate any help. Thanks in advance!
function fixUrl() {
if (location.href.indexOf("providername") > -1) {
newUrl = location.href.replace(".providername","");
location.href = newUrl
}
}
...
<body onload="fixUrl()">
That said, 1) it isn't tested, and 2) there are much nicer ways of doing this using your server or even some back-end scripting. For the long term, you should find the correct way of setting up a redirect using your webserver.
I did test this on the latest versions of IE, Mozilla, Netscape, Firefox and Opera. It worked on all of them.
Question #1: Will search engines frown upon this and do you think it will hurt me? What if I just used it on my product pages and not my categories or home pages - does that make a difference?
Question #2: If someone is blocking scripts from running or uses an older browser version will the browser just ignore it or will they get an error?
Thanks again - I really appreciate it. I owe you a beer...