Remove category from your WordPress url

January 8, 2009

Ever wanted to be able to finally remove the useless /category/ from your WordPress categories permalinks? If yes, read on and get ready to hack your .htaccess file. By default, WordPress category permalinks are displayed that way: http://www.livexp.net/blog/category/wordpress As you can see, the category in the url is pretty useless. Here’s how to remove it: First backup your .htaccess file. Then, open it and append the following line: RewriteRule ^category/(.+)$ http://www.yourblog.com/$1 [R=301,L] Once saved, your... [Read the full story]

Protect your WordPress blog from hotlinking

October 20, 2008

The first thing to do is to create a small image saying something like “Please do not hotlink from my server“. and upload it on your blog server. Then, we’ll have to edit the .htaccess file, located in your WordPress blog root directory. When modifying .htaccess, always create a backup. Append this code to your .htaccess: RewriteEngine On #Replace ?mysite\.com/ with your blog url RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ #Replace /images/nohotlink.jpg with your "don't... [Read the full story]

Redirect RSS feeds to feedburner with .htaccess

October 19, 2008

There is a very nice .htaccess hack to redirect your WordPress rss feeds to your feedburner feeds. Each time someone will click on a link to http://www.yourblog.com/feed, he’ll be redirected to http://feeds.feedburner.com/yourblog. Simply edit your .htaccess file, and paste the following. Don’t forget to alwyas backup your .htaccess file before editing it! # temp redirect wordpress content feeds to feedburner <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC] RewriteCond... [Read the full story]

Custom error pages using .htaccess

October 3, 2008

There is a huge list of things that you can do with .htaccess file like protecting folders with a password, redirecting your visitors, custom error messages, banning certain IP address or only allowing users with certain IP address, to stop directory listing, etc… In this article I am going to explain how to create your own custom error pages instead of using your host’s error pages or having no page. Custom error pages The 404 error message is an HTTP response indicates that the server couldn’t find what the client... [Read the full story]