Hi there,
I hope someone can help me.
I'm porting a blog from an extrememly restrictive provider onto a self-hosted solution. I don't want to lose bookmarked direct traffic and inbound links. The trouble is the restrictive blog provider doesn't allow server-side scripting or access to .htaccess files.
I've come up with an ingenious way of redirecting the traffic using a find and replace feature on the blog provider. I just need a script that will do the trick.
I need to:
1. Take the URL the page is on... (jttp://blogname.swagblogs.com/my_weblog/2008/09/crappy-name.html)
2. ...and replace the base with my new domain... (jttp://blog.goodblog.com/2008/09/crappy-name.html)
3. ...then lose the .html extension... (jttp://blog.goodblog.com/2008/09/crappy-name)
4. ...then send the browser onto the new URL
Caveats:
1. I intend to replace instances of </p> with <script type="text/javascript" src="scriptname.js"></script>, so really I need the script to still work when there are multiple instances of it on the same page.
2. The .html extension may not always be present
Can anyone help me please? I realise this is cheeky but I'm at my wit's end with this crappy blog hoster and I regret ever going with them!
I hope someone can help me.
I'm porting a blog from an extrememly restrictive provider onto a self-hosted solution. I don't want to lose bookmarked direct traffic and inbound links. The trouble is the restrictive blog provider doesn't allow server-side scripting or access to .htaccess files.
I've come up with an ingenious way of redirecting the traffic using a find and replace feature on the blog provider. I just need a script that will do the trick.
I need to:
1. Take the URL the page is on... (jttp://blogname.swagblogs.com/my_weblog/2008/09/crappy-name.html)
2. ...and replace the base with my new domain... (jttp://blog.goodblog.com/2008/09/crappy-name.html)
3. ...then lose the .html extension... (jttp://blog.goodblog.com/2008/09/crappy-name)
4. ...then send the browser onto the new URL
Caveats:
1. I intend to replace instances of </p> with <script type="text/javascript" src="scriptname.js"></script>, so really I need the script to still work when there are multiple instances of it on the same page.
2. The .html extension may not always be present
Can anyone help me please? I realise this is cheeky but I'm at my wit's end with this crappy blog hoster and I regret ever going with them!