Default .htaccess

HabschnedAnother day, another support question via the Facebook Site habschned.com. I probably should do a post about me not providing support via social media on that page and make it sticky hehe. Anyway, the guy that contacted me had some questions about the .htaccess file he deleted and how to get it back. Deleting the default .htaccess file is no biggie really unless you had hundreds of lines in it for your scripts/website.

Let me explain how to recreate the default .htaccess file and its content. All you need for doing so is a text editor (even Notepad will do) and a way of uploading the file to your 000webhost.com account. For the latter you can either use a FTP client like FileZilla or one of the File Managers 000webhost.com offers in their control panel. Honestly, i would go the FTP client way, a lot easier and more reliable than using the web based file managers.

Step 1

Grab a text editor of your choice and create a new document. Paste the following lines into the document, then save it to your computer as htaccess.txt

Step 2

Now fire up your FTP client (or one of the file managers in the 000webhost.com control panel) and upload the htaccess.txt file you just saved to your public_html directory. A common mistake is to upload the file outside the public_html directory and as a result of that it won’t work. So make sure you upload it in the public_html directory. In this example i now have two files in my public_html, default.php and htaccess.txt.

default
Step 3

The final step is to rename the file from htaccess.txt to .htaccess to make it work. Again, either use one of the file managers available in the 000webhost.com control panel or a FTP client of your choice. In the file manager select the file, then click Rename and change the file name to .htaccess. When using a FTP client simply do a right-click on the file, select Rename (or whatever it might be called in your FTP client) and change the file name to .htaccess.

000webhost.com Default .htaccess

And that’s it. You now have the default .htaccess file back in your account. Simple enough, isn’t it?

2 Comments on "Default .htaccess"

  1. I don’t know how to save this to my computer.

    • Toto Habschned Toto Habschned | August 24, 2017 at 06:02 | Reply

      That’s rather simple. Copy the two lines of code for the default .htaccess into the clipboard, then open Notepad (or whatever text editor you use) and paste them there. Then save the file as htaccess.txt to your computer and upload it to your public_html directory. Afterwards rename it from htaccess.txt to .htaccess and you are done

Leave a comment

Your email address will not be published.


*