Apache Redirect directive

Last Updated on Saturday, 2 July 2011 09:06 Written by A.Jesin Sunday, 13 February 2011 08:47

This tutorial describes how to use the Apache redirect directive to redirect your website to another URL. Redirecting to another URL and passing the correct HTTP headers is extremely useful from SEO point of view if you migrate your website/blog from one URL to another. Other than redirecting to URL you can also use the redirect directive to send certain HTTP status codes when a page is accessed. The Redirect directive can be used in both the httpd.conf file as well as .htaccess file. Read More…

Redirect http to https using htaccess

Last Updated on Saturday, 2 July 2011 08:58 Written by A.Jesin Tuesday, 23 November 2010 11:14

Redirect your website from http://www.example.com to https://www.example.com using htaccess file in your Apache web server. It is crucial to collect financial and confidential information from a person through HTTP over SSL to make sure the transactions are secure. A customer cannot be asked to type https  in front of the URL each your website is visited. So you can make sure they are automatically redirected to the HTTPS version of the website each time they visit the URL. Read More…

Redirect non www to www

Last Updated on Saturday, 2 July 2011 08:58 Written by A.Jesin Saturday, 20 November 2010 10:58

This article explains how to redirect your website from the non www url to the www url but editing the .htaccess file. This is necessary because search engines think that example.com and www.example.com are different websites. But since they both have the same content it might work negatively on the search engine ranking. So it is better to redirect example.com to www.example.com doing so this sends HTTP 301 status code when a search engine (or any user) accesses example.com. The 301 code says the non www domain has been “Moved Permanently” to the www domain. Before proceeding make sure the server has support for mod_rewrite. Read More…

Password Protect directories using .htpasswd

Last Updated on Friday, 17 September 2010 05:01 Written by A.Jesin Sunday, 12 September 2010 07:39

Anything uploaded to the document root (www, htdocs, public_html folder) of your web server is visible to the public that is why its always recommended to store confidential information outside the document root. But if you want that information to be accessed by selected people then you need to put it in a directory inside the document root and password protect it. Even thought server side languages like PHP and ASP can be used to handle authentication it can be cumbersome. So the htaccess and htpasswd can be used to simplify the whole process and make your life easier. Lets go step-by-step Read More…

Setting a Timezone in PHP

Last Updated on Monday, 20 September 2010 11:03 Written by A.Jesin Sunday, 29 August 2010 11:00

Using the javascript date/time function is easy because its a client-side language so it displays your system time. But its not the same case with PHP. Since its a server-side language it displays the server’s time which can be irritating because you might have your server located in another country and you might live somewhere else. But changing the timezone is just a few clicks away and whats more, you can even set different timezones for different pages/directories. Read More…

Disabling PHP Display Errors

Last Updated on Saturday, 9 July 2011 01:47 Written by A.Jesin Friday, 27 August 2010 09:51

Identifying the errors are very important when learning a new computer language or coding a program. Languages like C and C++ have compilers which display the error message and the lines which contain them only to the programmer (thats you). But with PHP when you’re running a live website and commit any errors in the programming it’ll be displayed to the entire world. Now there is nothing to feel ashamed because everyone commits errors (to error is human, right) the bad thing is that these errors reveal a treasure of information that a potential hacker can use against you and your website. This article will guide you through disabling PHP from displaying errors. Read More…