8 Don’ts For htaccess — Web Design Firm

8 Don’ts For htaccess

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.

 

« Previous Post    Next Post »

 

StumbleUpon reddit Digg Facebook Mixx Twitter Spinn Mail

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

24 comments

#1 Tweets that mention 8 Don’ts For htaccess | Web Design Company -- Topsy.com on 01.01.10 at 4:47 am

[...] 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 [...]

#2 8 Don'ts For htaccess | Web Design Company Scripts Rss on 01.01.10 at 7:52 am

[...] the rest here:  8 Don'ts For htaccess | Web Design Company By admin | category: Cross browser, Object | tags: are-certain, browser, Cross browser, [...]

#3 Jasa pembuatan web on 01.03.10 at 9:10 pm

Very good tips! i still learning about htaccess now, and your tutorial can solve our problem! thanks

#4 jamesparker on 01.04.10 at 4:46 am

Glad to know, the post is helpful for you.
My recent post 70+ Resources for Wordpress Theme Development and Learning

#5 Make Money Online on 01.04.10 at 12:33 pm

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

#6 FMS SEO » Happy New Year And Welcome To 2010 on 01.04.10 at 5:46 pm

[...] James Parker @ CyberDesignz.com [...]

#7 jamesparker on 01.05.10 at 4:33 am

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

#8 maine movers on 01.05.10 at 4:00 pm

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.

#9 Don Gilbert on 01.08.10 at 11:10 pm

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

#10 jamesparker on 01.11.10 at 5:49 am

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

#11 jamesparker on 01.11.10 at 7:10 am

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.

#12 4++ tips berdamai dengan htaccess | Side22Press on 01.12.10 at 3:30 am

[...] 8 perhatian berhubungan dengan .htaccess Tags : htaccess, optimasi, performance [...]

#13 Khaz on 01.18.10 at 1:40 pm

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 !

#14 You are now listed on FAQPAL on 01.18.10 at 8:31 am

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….

#15 favSHARE on 01.18.10 at 11:30 am

This article has been shared on favSHARE.net. Go and vote it!

#16 tripwire magazine | tripwire magazine on 01.18.10 at 11:32 am

[...] 8 Don’ts For htaccess [...]

#17 140+ Fresh Articles for Designers and Developers | tripwire magazine on 01.18.10 at 11:48 am

[...] 8 Don’ts For htaccess [...]

#18 140+ Fresh Articles for Designers and Developers | Afif Fattouh - Web Specialist on 01.18.10 at 3:39 pm

[...] 8 Don’ts For htaccess [...]

#19 140+ Fresh Articles for Designers and Developers | Programming Blog on 01.18.10 at 8:16 pm

[...] 8 Don’ts For htaccess [...]

#20 jamesparker on 01.20.10 at 5:32 am

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

#21 8 Don’ts For htaccess | Design Newz on 01.20.10 at 5:01 pm

[...] 8 Don’ts For htaccess [...]

#22 webdesign rosenheim on 01.21.10 at 6:09 am

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!

#23 jamesparker on 01.22.10 at 12:53 pm

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

#24 hgh on 04.21.10 at 5:57 am

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!