htaccess file is a configuration file which is run over Apache web server. It is used to configure different settings and functionality of the Apache server for a given website. These settings include URL rewriting, URL redirection, 404 Not Found page handling, etc. However, htaccess is quite sensitive configuration file and it may pose some problem including compromising over security of your website. Following are some of the point need to be considered while going with htaccess.
1. Careful about spellings
.htaccess is not conscious about spellings, so you have to be very careful about your spelling mistakes. Make sure, you don’t make any spell mistake.
2. Case sensitive
.htaccess is case sensitive. If something is shown in the examples with a capital letter, make sure it’s capitalized in your htaccess file. Don’t change the case of symbols and variables there.
3. Consider your caching
Considering your caching needs care before setting it up. If your site is almost entirely static, you can set longer cache times. If your site changes frequently then you should be able to identify only those files which are (not changed often) need to be cached and for how long. There’s nothing worse as a visitor than coming back to a site thinking there’s been an update and not seeing it.
4. Comment out your notes
Don’t forget to comment out your notes within the file. This is done by adding a # before the comment line.
5. Always test your site
Always test your sites immediately after making any changes to your htaccess file. One mistyped character could make the difference between your site working and being down for hours before you realize what has happened.
6. Backup you htaccess
On that note, always make sure you backup your htaccess file before making any changes. That is way, if there is a problem, you can easily swap back in the old file. Don’t forget to backup your htaccess file.
7. Cross Browser compatibility
Make sure any essential htaccess functions you’ve included are cross-browser compatible. There are certain things some browsers just won’t support.
8. Dont Forget to Secure
Remember when protecting a web directory with htaccess, that unless it’s restricted to https access, the password could be sniffed as your authentication will be done over an un-secure connection.
No related posts.















24 comments ↓
[...] This post was mentioned on Twitter by ryder – 8 Don’ts For htaccess – htaccess file is a configuration file which is run over Apache web server. It is used to co… http://su.pr/8QkPxx [...]
[...] the rest here: 8 Don'ts For htaccess | Web Design Company By admin | category: Cross browser, Object | tags: are-certain, browser, Cross browser, [...]
Very good tips! i still learning about htaccess now, and your tutorial can solve our problem! thanks
Glad to know, the post is helpful for you.
My recent post 70+ Resources for Wordpress Theme Development and Learning
I am always scared to play with my .htaccess file. I most probably look for my wordpress plugins which automatically will add any .htaccess rule if it want to ad rather than doing it by myself.. Thanks for the post.
My recent post 7 Twitter Tips For Beginners
[...] James Parker @ CyberDesignz.com [...]
That is not much troublesome but it is always good to get the things done in a good way. The WP plugin do good and probably that is the way out for those who are not sure about coding.
My recent post 10 SEO Tips for Web Designers
Good article. Was looking for some more info about htaccess. Though I probably should just leave the htaccess along for fear of messing up my site.
Good stuff here – some of it seems simple – but you have no idea how many times I killed a site by forgetting to comment out my comments. lol
I would suggest you to have some experience with htaccess by simply having the backup of the existing htaccess file so that in a case when something goes wrong you could bring everything back to life.
My recent post 5 Tips For Web Design That Sell
Don it would be funny experience though

I remember once my developer did so and the site was returning all 404 pages
It is always good to backup your htaccess file before making any chances.
[...] 8 perhatian berhubungan dengan .htaccess Tags : htaccess, optimasi, performance [...]
Very nice post. We shouldn't forget those don'ts.
I'm about to write a similar article about Lighttpd (but in French)
May I translate your article for the French community (With a backlink naturally)
Thanks in advance,
Khaz
My recent post Cinq invitations Google Wave à gagner !
8 Don’ts For htaccess…
However, htaccess is quite sensitive configuration file and it may pose some problem including compromising over security of your website. Following are some of the point need to be considered while going with htaccess….
This article has been shared on favSHARE.net. Go and vote it!
[...] 8 Don’ts For htaccess [...]
[...] 8 Don’ts For htaccess [...]
[...] 8 Don’ts For htaccess [...]
[...] 8 Don’ts For htaccess [...]
Thanks for writing, yes you can translate and I'd love to have a backlink
Thanks.
My recent post Style your Web Design Using CSS3
[...] 8 Don’ts For htaccess [...]
Thanks for this post!
It's always scary editing the .htaccess file. The better it is to have such a "don't" list!
Best regards!
Well, play with htaccess before making a backup of the working htaccess so that you may be confident to do any test with your htaccess file.
My recent post Style your Web Design Using CSS3
I was really looking for such post as i am in process of editing and uploading .htaccess file on my website. Luckily got this post which have helped me a lot. Its very difficult to edit .htaccess file if you don’t have enough knowledge. Thanks for the post!
Leave a Comment