Detailed .HTACCESS Setup Information for WordPress Blogs
Today’s guide is going to cover creating and setting up an .HTACCESS file for your web server and blog. This will allow you to create custom rules for how traffic and server requests to your site are handled.
I have broke the guide into sections based on questions I had when going through this project and learning how to configure the .htaccess file myself. You can follow the entire guide if you would like a detailed overview or read the title of each section to find the information you need.
(WARNING: Always backup your HTACCESS file before making any changes. This way if a change you make affects rules that are already in use they can be restored.)
01. What is HTACCESS and what does it do?
The .htaccess file is the default name of a configuration file that specifies rules for the way in which requests to a web server are handled. This can be something as simple as a 301 redirect from an old page to a new page (in the case that the old page has been removed or renamed) to something as complex as changing the format in which permalinks are displayed on your site.
It can also cover advanced functions like blocking specific IP addresses, or specifying file permissions on the web server.
02. How can I create and setup an .htaccess file
To setup an .htaccess file you need to first create the file itself. To create the .htaccess file, “right click” on your desktop and select the “New” > “Text Document” option.
Once you have created this file name it “htaccess.txt”. We will be changing this later but you need to do this to create a file we can edit. If you try to add the period before the file name (which is needed when the file is on your server) you will get a Windows error message that states.
** Rename ** You must type a file name
The reason this happens is because Windows will not handle files that start with a period, but unix and linux systems will. The htaccess file is a common component found on Apache web servers which are usually loaded on these types of systems.
To get around this we will make our changes to htaccess.txt in Windows, and then upload this file to the web server where we will rename it to .htaccess
To create a basic rule set for your .htaccess file you will need to copy the following code into the top of your text file.
RewriteEngine on
Followed by whatever rules you would like to assign for how your webserver should handle various requests. For our example lets assume you have an old website with a bunch of articles that you have converted into a blog.
To redirect traffic from existing links that point toward old HTML files, and send them through to the main page of your new site you could use the following command in your .htaccess file.
RewriteEngine on
RewriteRule ^([a-z]+).html$ /directory/newpage.html [R,NC,L]
Where /directory/newpage.html would be the location where you would like to send this traffic.
In the above example the carrot ^ designates that the base directory of your site is where the .htaccess file is located. (example www.yoursite.com). The .htaccess file must be located in the root directory of your website to work properly.
The $ indicates the closing of the rule or function you are specifying in your file.
You will see these used in other rules that can be used in the .htaccess file. For a comprehensive list of these commands and rules check the following link:
HTACCESS Configuration, Rules and Settings
The web server I was working on was a friend’s website which is hosted by Netfirms. If you are working with an htaccess file on a Netfirms account refer to the following documentation for examples of htaccess commands.
Netfirms HTACESS Command Examples
03. Windows will not let me create a file beginning with a period? What do I do?
As I mentioned above this is not a problem. The way to get around this is to take the htaccess.txt file we created and to copy it to the root directory of your web server via FTP. (of however you transfer your files.) Once the file has been transferred to your webserver it can be renamed to “.htaccess” because it is no longer on a Windows system.
Make sure that if you have an existing .htaccess file on your web server that you back it up. You don’t want to lose the file by overwriting it as it may already be specifying rules that are in use on your server. This is almost definitely the case if you are running a blog.
04. When I uploaded my .htaccess file the links to articles on my blog stopped working!?! HELP!
Uh oh! It sounds like you overwrote the existing htaccess file on your web server. Not to worry…
WordPress will create an htaccess file on your web server by default when you specify any custom permalink structures for your blog. This means if you have gone with the /%postname%/ option a lot of authors recommend, WordPress will have written a custom htaccess file to implement this permalink structure throughout your site.
To resolve this issue you need to recreate this file so the article links will work again. This can be done by going into your blogs admin panel, and selecting the “Settings” > “Permalinks” and clicking “Save Changes”. This should recreate your WordPress htaccess file and restore your broken links.
05. WordPress is overwriting my .htaccess file?
Yes. WordPress will overwrite your custom htaccess file if you upload one to your server and then change anything in the permalink options within WordPress, or load a plugin that utilizes these features.
This will cause your htaccess file to be overwritten and you will lose any changes you have made.
06. I need to use custom rules in the .htaccess file in addition to the changes WordPress makes. How can this be done?
You can actually edit the htaccess file that WordPress creates and add your own custom rules to it. This is very helpful if you are maintaining a large site or are converting old HTML documents to a blog format and need to redirect old links.
To do this you first need to generate the WordPress htaccess file. This can be done by following the steps in part #4 of this guide.
(Go into “Settings” > “Permalinks” > and click “Save Changes”)
Once you have done this, you should see an htaccess file appear in the root directory of your webserver. Copy this file to your computer via FTP so that you can edit it on your local machine.
You will notice that since you have copied the file from the web server, it has a file name that starts with a period and Windows will allow you to modify and save this file. (even though it wouldn’t allow us to name the file like this before.)
Open your file in a text editor so that we can make the necessary changes and apply your custom rules.
We are looking for an area in the file that looks like this:
# BEGIN wordpress
<ifmodule mod_rewrite.c>
rewriteEngine On
rewriteBase /
rewriteCond %{REQUEST_FILENAME}!-f
rewriteCond %{REQUEST_FILENAME}!-d
rewriteRule . /index.php [L]
</ifmodule>
# END wordpress
If your code looks different than this it is most likely because your looking at the file in notepad. We will actually need to use a proper text editor to modify this file correctly. If you do not already have one read sections #7 and #8 for a good free PHP editor.
Once you see the block of code I referenced above you will need to make the following change. Add this block of code above the “# BEGIN wordpress” section in the file:
<ifmodule mod_rewrite.c>
RewriteEngine On
CUSTOM RULES ARE ADDED HERE
</ifmodule>
Once you have done this your file should look similar to the example below:
<ifmodule mod_rewrite.c>
RewriteEngine On
redirect 301 /olddirectory/oldpage.htm http://www.newsite.com/
</ifmodule>
# BEGIN wordpress
<ifmodule mod_rewrite.c>
rewriteEngine On
rewriteBase /
rewriteCond %{REQUEST_FILENAME}!-f
rewriteCond %{REQUEST_FILENAME}!-d
rewriteRule . /index.php [L]
</ifmodule>
# END wordpress
The rule above is just an example. For more information on htaccess rules refer to section #2 and the links provided for the proper use of different rules and functions.
Now that you have made the listed changes you can upload the htaccess file back to your web server and overwrite the old one. (As mentioned before always backup the old htaccess file incase something goes wrong.)
The file should now utilize your custom rules in addition to allowing WordPress to update the file as needed without overwriting the changes you made.
The custom rules need to be listed outside of the “# BEGIN wordpress” tag and need to come before this function to avoid being overwritten by WordPress.
You should now be able to test your custom rules by trying to access old files on your server. If run into an issue triple check your rule syntax to make sure it is correct as this could cause a problem.
(Keep in mind that you cannot easily test custom rules by overwriting your WordPress htaccess file with one you created in Windows, because any permalink structures you reference will be destroyed when you overwrite the WordPress generated htaccess file on the server.)
From here any issues you might be running into will most likely need to be researched in Apache help for htaccess or on various forums. Good luck!
The following sections provide additional information on other issues that may come up during the process I outlined, or questions people may have that were not covered in the previous sections.
07. When I open the .htaccess file created by WordPress it is garbled, and shows carriage return characters. (Squares)
It sounds like you are looking at the file right through notepad. To display the information correctly you need to download a proper editor. Since we are working with PHP files for most things with our blog we should download a PHP editor to use with our files.
08. Where can I get free PHP editor software for editing my files?
When I was working on this issue the other day I came across a great free editor called “Arisesoft Winsyntax”. It is a very small download, does everything I need it to do, is easy to use, and is completely free to use.
You can download it from the authors homepage here:
09. I have seen the custom .htaccess code created by WordPress mentioned on other blogs but no one has told me where I need to go to find and edit this code.
The code be located in the custom .htaccess file that WordPress creates on your web server. Follow the steps outlined in section #4 of this guide to create the file.
Once the file appears on your web server in your root directory you will need to download this file to your computer so you can edit it. Open this file in a text editor (as outline in sections #7 and #8 and you will see the code people have been referring to.
10. I am trying to create some custom rules for an old site that I am converting over to blog format, but some of the pages I am trying to redirect are not working. It seems like .htaccess is ignoring these files?
Hmm. It could be a number of things. The main cause I found for this issue is that the file you are trying to reference in your .htaccess file is using characters that are not “web friendly”.
In my friends case they had created file names like index[new].html and new page title.htm
.htaccess really seemed to take issue with the fact that they were using strange chacters like ] [ and spaces in the file names. Always make sure you are using web friendly file names and urls to help minimize potential problems down the road.
Overview
I hope this guide has helped answer some of the questions people may have about creating and setting up the .htacess file. This information can be used for a standard server also, but a lot of the situations I outlined pertain specifically to WordPress blogs.
If you have any questions of comments please feel free to post, and I will try to answer them if I can. I am not an .htaccess guru by any means. I am just outlining the pitfalls I ran into to help others avoid these problems.
Thanks for checking out Pseudorant. We appreciate the support!
Wordpress Stats Plugin is not Working or Gathering Information
WP Stats is not displaying any information for my blog!
If you are a blogger then you probably use the WordPress Stats plugin. For those who don’t, it is a plugin that gathers various statistics from hits to your blog. It gathers information on the number of page views, the most popular posts, search terms people use to find your blog, what sites send send you traffic, and lot of other great stuff.
Now imagine how lost you would be without this information. I recently ran into a situation where this was the case, and after a little research I was able to find out why WP Stats was not working on this particular blog.
I was helping a friend get their blog setup, and we ran into quiet a few issues. They were transferring an old website they barely maintained over to a blog format to make it easier to update and manage the information they already had.
During all the troubleshooting involved in switching the old site over to a blog, I noticed the WordPress Stats plugin was not gathering data. I tried several things to fix this, deactivating and restarting the plugin, re-entering the API key, checking settings in the admin panel and on WordPress.com, uninstalling and reinstalling the plugin, updating the plugin. None of this seemed to work.
Then I came across a post on the WordPress.com forums talking about this issue. Apparently on some themes there is a function that is left out of the footer that is needed for WP Stats to work correctly. If this is the case with your theme, that is probably what is causing the problem. To fix this you need to go into the “footer.php” file in your theme editor.
In the footer.php file scan to the bottom and look for the “</body>” tag [without the “ “]. Once you have found the tag you will need to insert this line of code above it:
<?php wp_footer(); ?>
Once that is done update (save) the file and then test WordPress Stats to see if it is working.
You may want to do this by logging out of your blog admin panel, and them clearing your cookies and temporary internet files. Once you have done this go back to your website and browse through a couple pages and this should generate a couple page views in WP Stats.
You need to make sure you are logged out of admin, and to clear your temp files or else your blog will not count hits from you because it will think you are the admin.
Hopefully your WP Stats plugin should be working now, and you will see your test page views showing up in the stats. If you see those page views WordPress Stats should now be working correctly.
Thanks for checking out Pseudorant. We appreciate the support!
How to tell what Font a website is using
How can I figure out what Font a website is using
The other day my fiancée was working on her website and she was looking at other sites for inspiration. She came across a site that she really liked and they were using two different fonts that she thought would look wonderful on her site.
She was messing around with the default fonts that were available to her through WordPress and her style sheet and she told me that she couldn’t find the right ones. I told her there was a trick she could use to figure out what fonts a website was using if she would to like to use them on her website.
The first method I recommended to her, which is the easiest way goes as follows:
Method #1
1. Copy a line of text that uses the font you like from the website you are looking at.
2. Once you have copied the font, use Open Office (or MS Word) or any other program that retains formatting when you paste text into it.
3. Paste the copied text into the word program and highlight it.
4. Go into your text options in the word program, and the font that the program has defaulted to should be the text that is being used on the site you are looking at.
You may want to compare a sample of the text using that font on your site and see if it has the look you desired. If the text matches then you know you have determined the correct font.
There may be some cases where the fonts do not match if the person is using a special font. By default most browsers will display any common fonts but if the website is using a strange font the browser will default to a font that is similar to the one being used.
The other method which requires a little more digging around but can be quicker if you are familiar with HTML. It can be utilized by doing the following:
Method #2
1. “Right Click” on the web page and choose the “View Source” option from the menu.
2. Once you have done this a text editor will open with the HTML from the website being displayed.
3. Click “CTRL+F” to open the “FIND” window in the text program.
4. Type in “FONT” and then click “Search”
5. The text program will now locate every instance of the Font tag in the HTML. This will allow you to determine what types of fonts are being used throughout the page.
Take a general look at all the fonts to get an idea for what font is being used most. Most designers will usually not use more than two types of fonts so it should be easy to figure out which one is being used most.
In some cases the site may rely heavily on a style sheet for setting the font. This is a common practice now a days. Even if this is the case the author or designer will sometimes specify fonts manually for certain areas of the page so the “FIND > Font” method is still a good trick to use.
This can come in handy when people are redesigning their site or trying something new on their blog. It’s really amazing how much fonts can affect the look and feel of a site and choosing the right font can really help you improve the overall appearance of your website.
Thanks for checking out Pseudorant. We appreciate the support.
Totally Useless HTML Element of the Day – The <'em'> Tag
EHH<EM>!… Can I have your attention please!</EM>
Today I would like to talk about the <EM> HTML tag. While searching for information on another apparently useless HTML meta tag, I came across the definition for this HTML element.
The <EM> tag is used to put words in an “Emphasis” style, which strangely enough looks just like italics.
For Example!
There is apparently a distinct difference between the two tags though. The HTML standard defines the <EM> tag as being a “logical style” where the <I> tag is considered a “physical style”.
What this means is that a “physical style directs the browser to display in an italic typeface whereas the logical style directs the browser to display with a distinctive emphasis leaving it to the browser to decide how this is achieved (underlining or distinctive colour might be used).”
(Reference - http://www.scit.wlv.ac.uk/encyc/em.html - Page is no longer available)
In order to further explain the “Emphasis” tag the staff at the University of Wolverhampton performed several experiments with the <EM> tag in different browsers to see how the tag would be displayed. These were their findings:
“All browsers rendered the text using an italic typeface.”
(Side Note: In all fairness, blogs do happen to use the <EM> tag but they use it to create the effect that you get when you click on the “Italic” button in your editor.)
As always thanks for checking out Pseudorant. We appreciate the support.
New WordPress Theme & Logos – Revolution Hacked
New Logos Compliments of Aaron Gilmore
As many of you have probably noticed, Pseudorant has under gone a major change. That’s right! We have a new theme. The theme we are using is a modified version of the “Revolution” theme by Brian Gardner.
After collaboration between me and Joe we decided this theme would best suit the needs of the site in the coming months. We have been planning a lot of major upgrades and additions to the site so we are trying to get a good infrastructure in place ahead of time.
Areas to note in the new theme are the RSS Subscription Icon and FeedBurner Widget which Joe incorporated into the sidebar menu. The addition of 125px sponsor slots and EntreCard widgets. A Top Posts Widget which is currently under going some repairs, and much more!
For those who have been to the site in the past 20 hours you have probably noticed things breaking and being fixed. We apologize for the inconvenience. The bug search is ongoing and just when we have one thing fixed we come across something else that needs to be reworked. If you come across anything on the site that seems broken please let us know. (Email – Paul | Joe)
NEW LOGOS!
The biggest point of interest on the site is our new custom-made Logos! Pseudorant’s new Logos were designed by Aaron Gilmore.

He has an extensive background in Adobe Illustrator, Photoshop, traditional illustration techniques and classic art styles.
He accepts commissions for all of his work, and quotes very affordable prices so anyone can afford to have their site look better than the competition!
If you are looking for an amazing artist that you can afford to work with, I would highly recommend contacting Aaron for any of your project needs.
For more information check out Aaron’s website at:
As always thanks for checking out Pseudorant! We appreciate the support. Please bear with us through the new transition and you will be happy with the future updates we will be bringing you!




