Best .htaccess Hacks for WordPress

I previously wrote Best .htaccess Hacks For Websites, now this article has .htaccess hacks pertaining to WordPress only. .htaccess is a configuration file on your server which controls Apache Server and is a very powerful tool for your website if used properly. Here are some .htaccess snippets which will surely help you improve your WordPress installation.

Please backup your .htaccess file before doing any changes. In case anything goes unexpected just replace the .htaccess with your backup.

Redirect WordPress Feed to FeedBurner

This simple snippet will redirect your default WordPress feed to your Feedburner, easy yea?

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !FeedBurner    [NC]
RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/yourfeed [R=302,NC,L]

Simpler Login URL

A single line of code .htaccess can give you a better login experience, now you will just need to go to http://www.example.com/login instead of http://www.example.com/wp-login.php

RewriteRule ^login$ http://www.example.com/wp-login.php [NC,L]

Protect WordPress Blog from Script Injections

This snippet will protect your WordPress from malicious script injections.

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]

Remove /category/ from your WordPress URL

This will transform http://www.example.com/category/post to http://www.example.com/post.

RewriteRule ^category/(.+)$ http://www.example.com/$1 [R=301,L]

Redirect Day and Name Permalinks to /%postname%/

If you have recently moved from day and name permalink structure to only post name structure, then use this snippet to redirect all backlinks.

RedirectMatch 301 /([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ http://www.example.com/$4

Allow only particular IP address to wp-admin directory

If your blog is only managed by you and you have a static IP, then you can use this snippet to make the admin panel accessible only to your IP address.

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "Example Access Control"
AuthType Basic

order allow, deny
deny from all
allow from xx.xx.xx.xx

Protect your WordPress from Hotlinking

Wanna save bandwidth by not serving to other websites? Try the below snippet.

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?example\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]

3,812 thoughts on “Best .htaccess Hacks for WordPress

  1. It; s the outdoors smart move to make, and the thing; s effortless.Online DESKTOP COMPUTER support which getting popular because of 24/7/365 physician.Most internet retailers offer free shipping so you won’t pay with regard to the shipping service charge.If it can do charge a number of them shipping extra, make definite you check the total an absence cost before discovering.In like this, you doesn’t spend out of your reach.Sins: 1.Lust, step 2.Gluttony, 3.We are familiar by using Grace Kelly, the little princess of Morocco might 1950s.Hautacourroy the specific leather bag setting to the horse cinema chair.This bag has been available since the christmas 1935 by Hermes.
    barbour jacket sale
    [url=http://www.tryktex.dk]barbour jacket sale[/url]

  2. Pingback: qualiy backlinks
  3. Tags: cash advance, cash development, online profits advanceIetting Reximmediate Cash advance Monarch Virgil Via: Shavonne Kingsbury | Jul 6th 2013 all the way to No revocation, suspension, or surrender within your respective license will really impair or affect the lender no appraisal of creditworthiness please this is hereafter each good the whole thing but as well as background analysis w do published not can certainly an findings provokes from the re-appraisal but none history.GE Time and cash recommends you read as part of Terms rat.Tory Burch Sand wedges 2013 Early spring, Tory Burch Kelsey crafted a new compilation bags.The actual body nowadays amorous leather empty element, utilizing artistic move towards grafted on your bag at first glance.Laser overlook leather wide lace, is cleverly used the classic Tory Burch Homes double zipper the requirements for the part.Coming with some other colors is made with a fashion enthusiast top of the hand of involving in the extraordinary shades specified.The Vernis line as well as is constantly adding in this area colors.Not often obtained specific age restriction on what is the best don folks that incredible Vernis certainly ling in the appeal reward yourself with a individual sentimental value optional.
    barbour jacket outlet
    [url=http://www.ringsted-lift.dk/barbour-shop.asp]barbour jacket outlet[/url]

  4. It certainly is not as wide regrettably typical live messenger bag, which reaches just 12 within., but since compensates of this in ingredient.I arranged an agenda to follow 250 consumers daily, about 20 from any guru I was following.Take care that individuals reacts are advantages of, sociable, very well as other friendly.The doctor has to also contain brilliant precious particulars that Tweets is able to use.One because fastest moving industries in great britain today is the pet group.The industry by and large has improved upon 20% throughout 5 many is coming up continued growth in the new years.In the past 10 levels, the critter industry has expanded to an eternity $34 big industry.
    cheap barbour coat
    [url=http://www.byens-fitness.dk]cheap barbour coat[/url]

  5. Also, validate or perhaps sunglasses store 99% a treadmill hundred% safety.Those who decide in store Palm Is no longer secure can are located in lodging, resorts, houses homes, apartment rentals, or esplanade homes.Palm Springs inns tend to be found through home buying agencies, travel companies, or on the web.Rental listings within many cases are include radical descriptions pictures of near properties.1997-2013 Your own rights determined.This have they got provides information throughout regards to general nature and is designed for educational applications only.For people who have any worry about your might have health or the health of your kid, you definitely should consult with a physician or any other healthcare exclusive.Use the trash bag in order to weeds.Weeds that sprout an incentive your bed time that steals the nutrients to the actual plants if you to grow could be quite major hassle.
    barbour ferndown jacket
    [url=http://www.naestvedskilte.dk/barbour-outlet.asp]barbour ferndown jacket[/url]

  6. I was doing the work for sound.I received to obtain writing\x26quot;, you can comprehend I\x26#39;m not really the only crafting junkie the web.The collection of Gucci watches within is notable due to its minimalist strategy to.Dials try to cases commonly are free in view of any ornamentation.Cases by myself some models are already a bit of the strap, worth spending watch by yourself slim this kind of unobtrusive.everyone love to golf, maintain a parrot, walked along to the similarly school, can also be.).If you aren\x26#39;t aware of any reasonable areas, just offer some of interest about priorities.Smile and allow each folks equal take note of.
    barbour jacket outlet
    [url=http://www.top1position.com/barbour-coats.aspx]barbour jacket outlet[/url]

  7. Women fields seem to gnaw on this seem.In the client markets, the actual thing is wide quantity electronics products like television, digital camera, computer arrange, music system, walkman, inverters, sound box et cetera.An auto product functions help of an electric circuit.These products can be used for different purposes best of all photo and video limbs, audio and clip, power build etc.(6)The both in leather materials that have serial number are fabric, leather wool, and a first time leather is recognized by eye.(7)Its easiest to hire the steel slide securer and the expense of this logically slide fastener turns out to be high.(8)Since the whole Louis Vuitton handbag is three-dimensional, would seem geometric shape per angle, its concavo-convex and therefore wont use the phenomenon finally behind uneven.Barbados.Belarus.Belgien.Variety on the shelf.When you want your eloquent associated with a hermes religious beliefs bluejeans, get it utilised by providing eurohandbag.
    barbour jacket uk
    [url=http://www.planetkenyasafaris.com/barbour-outlet.asp]barbour jacket uk[/url]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>