How to Ditch the WWW from Your Domain Name

Posted on May 17th, 2009 in Apache, Tutorials | No Comments »

Personally, I prefer to have http://domain-name.com rather than http://www.domain-name.com

In fact, unless you specify that they are the same site, Google can treat them as seperate Websites, and you would be diluting your page rank!

So:

Connect to your website via FTP. Find your .htaccess file (usually in your public_html/www folder). If you can’t find one, just open your text editor (notepad will do) and save it as “.htaccess”.

Find some clear space, and type the following:

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^www.domain-name.com$ [NC]
RewriteRule ^(.*)$ http://domain-name.com/$1 [R=301,L]

Simple? Yep!

Save & Upload! Sorted!

note: this is to UNIX-based machines only (UNIX is the most popular out there..)

Any questions just send me a direct message or leave a comment.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • Yahoo! Buzz
  • Twitter
  • Technorati
  • Live
  • LinkedIn
  • MySpace
  • Share/Save/Bookmark

Hacking TweetMyBlog (TwitterFeed Sucks)

Posted on May 17th, 2009 in PHP, Tutorials | 1 Comment »

I used to use TwitterFeed; but recently it’s been a real pain in the ass and not updating so I looked for an alternative.

Roll on TweetMyBlog.

TweetMyBlog is great for the simple fact that it is a WordPress plugin. It’s also a small download, and you can install it very easily. However, TweetMyBlog is hard-coded to use TinyURL and the URL it “makes tiny” is an affiliate link taking the user to a framed page. This is a bit of a bummer for me because I like to use bit.ly and I don’t really want my users going to some 3rd party site.

Roll on TweetMyBlog Hack

I took at a look @ the files and realise we can very easily change the Plugin to use bit.ly instead of TinyURL using the bit.ly API.

If you have installed TweetMyBlog you would have uploaded the “tweetmyblog” directory which had 3 files in it. Go and find, “twitter_api.php”:

and at the very bottom of the file you will see:

function get_tiny_url($url)
{
$this->snoopy->fetch('http://tinyurl.com/api-create.php?url='.$url);
return $this->snoopy->results;
}


As you can see, it uses TinyURL.

I’ve only hacked it to use bit.ly, but this is what I changed it to first (don’t copy it yet, there’s a better version further down):

   function get_tiny_url($url)
	{
    $this->snoopy->fetch('http://api.bit.ly/shorten?version=2.0.1&login=bobbyjason&apiKey=MYLONG_BIT_LY_API_KEY&format=text&longUrl='.$url);
	 return $this->snoopy->results;
	}


I gave it a shot, and sure enough it worked, I was using bit.ly instead of tinyurl, result! However, it was still using the silly Affiliate link with a frame & 3rd party site.

Okay, open “tweetmyblog.php” at around line 36 you will see:

$tweet = trim($tweetPrefix).' '.$blogPost->post_title.' '.$t->get_tiny_url('http://www.tweetmyblog.com/bpredir.php?r='.$tmb_affid.'&bp='. urlencode(get_permalink($postID)));

The problem is the tweetmyblog.com redirection, so I replaced it with this:

$tweet = trim($tweetPrefix).' '.$blogPost->post_title.' '.$t->get_tiny_url(urlencode(get_permalink($postID)));

Easy, right?

Well, this works great.

I do not need to use TwitterFeed ever again because WordPress automatically Tweets my blog post! I don’t have to wait 30 minutes, 1 hour, 5 hours for TwitterFeed to notice my blog post.

There was one last change that I made; after using the code above (using the bit.ly api) I realised that the URL wasn’t showing up in my bit.ly history. I checked this out and realised I needed to use the history=1 parameter. After I added this I’ve not had a single problem at all.
For the final code of “twitter_api.php”, see below:

function get_tiny_url($url)
	{
    $this->snoopy->fetch('http://api.bit.ly/shorten?version=2.0.1&history=1&login=bobbyjason&apiKey=MYLONG_BIT_LY_API_KEY&format=text&longUrl='.$url);
	 return $this->snoopy->results;
	}

I must say though; TweetMyBlog is a great plugin by John Merrick and Sean Jordansen and you should install it.

If you wish to monetise your tweets from your blog, then the above edits are silly. It’s just personally I would rather not have the user taken to a 3rd party site.

TweetMyBlog also provides a feed of your Tweets as a Widget, so it really is great!

Download TweetMyBlog now!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • Yahoo! Buzz
  • Twitter
  • Technorati
  • Live
  • LinkedIn
  • MySpace
  • Share/Save/Bookmark

Increase Your Web Presence with Google Webmaster Tools

Posted on May 17th, 2009 in Advice / Tips | No Comments »

It’s one thing to get your site showing up in Google. It’s another thing to make sure you get all your pages into Google.

The easiest way to do this is by using an XML sitemap & Google Webmaster Tools (GWT).

GWT allows you to analyse your website from the Google Bot’s perspective to ensure that all your links are working, your meta tags are not duplicated and many other things such as setting the rate at which bots visit your site.

All you need is a Google Account & access to the HTML of your homepage.

Once you’ve signed in, it’s fairly easy to follow the on-screen instructions to setup your domain.

Google will index your pages, and you can also use your sitemap on Yahoo!, Live and other search engines.

If you dont have it already, get Google Webmaster Tools now!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • Yahoo! Buzz
  • Twitter
  • Technorati
  • Live
  • LinkedIn
  • MySpace
  • Share/Save/Bookmark

My 7 Must-Have Plugins for WordPress

Posted on May 16th, 2009 in Advice / Tips | 1 Comment »

I make sure I use these on ALL my WordPress blogs. I use many more, but this is a list of plugins that I think anyone who is serious about maximising the potential of their blog should be using.

All in One SEO Pack
Google Analytics for WordPress
Google XML Sitemaps
TweetMyBlog!
wp-cache
Add to Any: Share/Bookmark/Email Button
YARPP

If you have others that you believe are essnetial and should be mentioned then leave a comment and I shall consider updating this list.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • Yahoo! Buzz
  • Twitter
  • Technorati
  • Live
  • LinkedIn
  • MySpace
  • Share/Save/Bookmark

8 Simple Reasons You Should Signup to Twitter

Posted on May 16th, 2009 in Advice / Tips | No Comments »

This is Step 2 of the “How to get your site into Google” post

The other day I was using Twitter and caught a glimpse that Katie Price & Peter Andre had split up. I Googled for it and couldn’t find any news about it. What was splashed on newspapers the next day? Their divorce.

Twitter BEAT Google. Now that’s serious because many folk use Google is their primary source of finding information and suddenly you have this website [twitter] with instant news!

If that doesn’t convince you, let me list some reasons why you should sign up:

1. You want to keep “connected” with like-minded individuals. Twitter is great for this.
2. It quick – to post an update it takes less than 30 seconds. A few updates a day with latest news and you’re sorted.
3. It’s easy. Really, it is.
4. It’s viral. Do it right and your news can be splashed around the net in a matter of hours, if not minutes.
5. It integrates with everyday tools like WordPress. You can even post from messenger & your mobile.
6. It’s live. The information on here is real-time news.
7. Social – it’s the easiest way to tell folks about your latest blog post and get those important comments.
8. And… well: it’s free; in this current climate you should grab everything that’s free!

Take all the points above, and you have a serious tool: its the mobile web; in real-time.

Sign Up Now!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • Yahoo! Buzz
  • Twitter
  • Technorati
  • Live
  • LinkedIn
  • MySpace
  • Share/Save/Bookmark