How to create .htaccess file?

After publishing m previous article many people are asking me that how should they create the .htaccess file in Windows OS. First of all let us make this thing clear that you will not be able to create .htaccess file on a Windows OS because in Windows you require to name a given file but in this case we are just creating  a file without name and just extension which will be illegal for a Windows OS.

You can overcome this problem by following the steps listed below:

  • First creating a htaccess.txt file in Windows OS
  • Open the file and add all the necessary code and commands to it and than save it.
  • Upload the file to your web server via FTP or via cPanel or any other panel provided by your webhost.
  • After uploading rename the file htaccess.txt to .htaccess in the interface provided by the cPanel of your webhost.

I hope you now know how to create .htaccess file.