Creating a .htaccess file

If you have a Linux web hosting plan then you can use the following instructions to create an .htaccess file:

  1. Open up a text editor on your computer such as Notepad (Windows), TextEdit (Macintosh), or Emacs (Linux). Others are widely available.
  2. Save the file as .htaccess (including the initial dot).
  3. Make sure that your text editor did not append a .txt suffix to the file name. (In Windows, you can do this by right-clicking the icon for the text file and selecting Properties.) If the file name does have a .txt suffix (i.e. ‘.htaccess.txt’), remove the suffix by renaming the file.
  4. Before entering code into your new file, make sure that Word Wrap is turned off. (In Notepad, select Format… from the top navigation bar and make sure that Word Wrap is unchecked. This is important because most .htaccess commands need to be placed on one line only.
  5. You can now enter your code into the file.
  6. Upload the .htaccess file via FTP into your web space in ASCII mode or using the online file manager available in your control panel. The .htaccess file will affect the folder that it is uploaded to and all of its subfolders. Also, make sure you have your FTP client set to show hidden files if you want to be able to see your .htaccess file on the server.
This entry was posted in FAQs, Linux & PHP and tagged . Bookmark the permalink.

2 Responses to Creating a .htaccess file

  1. Pingback: Pipe Ten Web Hosting Resource » Blog Archive » .htaccess cheat sheet

  2. Pingback: Logging PHP Errors using .htaccess | Web Hosting Resource

Leave a Reply

Please DO NOT use this form to submit support requests, all information submitted will be PUBLICLY VISIBLE.

Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>