Tag: proxy

How to "JAILBREAK" your wordpress.com blog

Wait a minute, “Jailbreak”? for wordpress.com blog? You gotta be kidding me!

Unfortunately that word goes best with your iOS devices. No one jailbreaks anything else. So pardon me for using this word to grab your attention. Back to the article, tell me what will you do in following cases

  • You want to deliver your regular wordpress.com blog from your own domain
  • You have a great blog you maintain in wordpress but you also want to deliver the contents from a subdomain of your choice
  • You want to use Facebook comments instead of wordpress’s own commenting system

The answer of #1 comes at a price of $25 (min). The answer of #2 is still possible by paying $13 and #3 is not possible at all as long your blog is hosted with wordpress.com.

Moreover you certainly be missing few jQuery tweaks all over your site which you could do with your hosted wordpress blog. But wordpress.com is awesome, scalable and you don’t want to host your blog with pesky/cheap hosts.

For this purpose, use wordpress-com-proxy script which is a small script runs in your hosting and deliver your wordpress.com blog from this domain. The masking and rerouting is very good so that your visitors will not be annoyed. Moreover you will have the Facebook comment plugin enabled by default to increase the engagement.

Using this script is very very easy. Follow the instructions available at https://github.com/hasinhayder/wordpress-com-proxy. All you have to to do is check out the script, modify two lines in config.php and upload somewhere (we suggest using a PaaS like AppFog or OpenShift or PagodaBox for hosting because they are just great!)

For a running example, See my actual blog at http://hasin.wordpress.com which is proxied from http://wpproxy.rs.af.cm for demonstration purpose.

wordpress-com-proxy also loads jQuery in the context so that you can now give your blog awesome look and perform amazing things as long as it is possible with jQuery. Check out the script from https://github.com/hasinhayder/wordpress-com-proxy and Enjoy your jailbroken wordpress blog

Shameless Plug

We develop beautiful Admin Panel templates for the web application developers. Our recent product is “Bolt” which is responsive and built on top of Twitter’s bootstrap. Give it a try and let us know how do you like it.

Bolt Responsive Admin Panel Template for Developers
Bolt Responsive Admin Panel Template for Developers

host your <wordpress.com> blog anywhere, using this 10 lines of proxy script

q1. why the hell someone would do that?
a1. if you bought some interesting domain like i do (heh heh) http://blog.ofhas.in and want your existing blog to be available there as well, without spending hours to move data and to give it same look-n-feel – here’s your time-saving wizard. and beside that, i also dont want to lose my existing blog but i just want to avoid the hassle of re-hosting/migrating 🙂

q2. oh really?? how can I do that?
a2. here you go

<?php
$dataurl =$primaryurl = "http://hasin.wordpress.com";//old domain
$secondaryurl = "http://blog.ofhas.in"; //new domain
$path =array_keys($_GET);
if(!empty($path[0])) $dataurl = "{$primaryurl}/{$path[0]}";
$data = file_get_contents($dataurl);
$pattern = "~{$primaryurl}/([\d\S\/]+)~";
$data = preg_replace($pattern,"{$secondaryurl}/$1",$data);
$data = str_replace(array("<a href=\"{$primaryurl}","<form action=\"{$secondaryurl}"),array("<a href=\"{$secondaryurl}","<form action=\"{$primaryurl}"),$data);
echo $data;
?>

q3. is that all?
a3. nope, you need to modify/write .htaccess file in the root of this new domain


RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} (.+)
RewriteRule ^(.*)$ index.php?$1&%{QUERY_STRING}


RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

this script will also change the urls of all your post and pagination, behaves exactly same as you have hosted your blog in this new url. only drawback is submitting a comment will take you to your original domain, but you can easily fix that but simulating a POST request using curl/stream wrapper/fopen. there is one more vital drawback which is you may lose some IP specific traffic data

have a look at my actual blog http://hasin.wordpress.com and new one at http://blog.ofhas.in

happy weekend!