PHPGurukul

What is .htaccess

1) Type <?php phpinfo(); ?> in a php file and save it and run that file in the server. 2) And now you can the list of information, just search the word “mod_rewrite” from the browser’s search menu 3) If it is found under the “Loaded Modules” section then this module is already loaded as you see in the picture below, otherwise find  the “httpd.conf” file under the “conf” folder inside the Apache’s installation folder. Now find  the following line “#LoadModule rewrite_module modules/mod_rewrite.so” in the “httpd.conf” file. 4) Remove the “#” at the starting of the line, “#” represents that line is commented. 5) Now restart the apache server. 6) You can see now “mod_rewrite” in the Loaded Module section while doing “phpinfo()”. If your .htaccess file does not work in server , you should contact your system administrator or web hosting company and ensure they have enabled .htaccess within your account.

Creating A .htaccess File

Creating a .htaccess file may cause you a few problems. Writing the file is easy, you just need enter the appropriate code into a text editor (like notepad). You may run into problems with saving the file. Because .htaccess is a strange file name (the file actually has no name but a 8 letter file extension) it may not be accepted on certain systems (e.g. Windows 3.1). With most operating systems, though,all you need to do is to save the file by entering the name as: “.htaccess” (including the quotes). If this doesn’t work, you will need to name it something else (e.g. htaccess.txt) and then upload it to the server. Once you have uploaded the file you can then rename it using an FTP program.]]>

Anuj Kumar

This is Anuj Kumar. I’m a professional web developer with 4+ year experience. I write blogs in my free time. I love to learn new technologies and share with others.
I founded PHPGurukul in September 2015. The main aim of this website to provide PHP, Jquery, MySQL, PHP Oops and other web development tutorials.
.

Recommended Tutorials for you


3 comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.