What is an htaccess file?
Back to web hostingAn htaccess file is one that allows you to do things such as the following:
- Redirect your visitors to a website placed in a separate directory.
- Overwrite the address of your website which is visible in the address bar.
Previously the htaccess was also used to raise php values, this was done with the php_flag and php_value values, depending on how the php is installed this can cause problems. In that case you can modify the php values via a .user.ini file.
There are a few points to consider when using a .htaccess file:
1. Note that a .htaccess is always picked up before an index file.
If there is an error in the .htaccess, the whole website will give an error (500 internal server error).
2. The dot before it is necessary, always use .htaccess instead of htaccess, without a dot it will not be picked up, make sure the htaccess is in the root directory of the website.
3. Not all programs / operating systems show files starting with a dot by default. In fact, this is used for hidden files. Should you not see a .htaccess file and want to, you can do this as follows: In Windows Explorer, choose View, then click on options. Select the View tab, and then select: show hidden files folders and drives .
How do I create a .htaccess file?
- Open the program "notepad."
- Place the code you want to run in the file.
- Save the file by clicking on 'File' in the menu bar. After this, choose 'Save as'.
- Save the file with the type 'All Files'.
- Enter the file name: ".htaccess". Make sure that the file name is empty and that the extension is .htaccess.
- Using an FTP program such as Filezilla, place the file in the "Public_HTML" of the website.
Contents of the .htaccess file and options
Example:
Redirect website visitors permanently to a website located in the"Joomla" folder.
Now this is a simple example, but it is also possible to use more complex codes.
More examples can be found by using Google, or by hiring a programmer for this purpose.
Please note that we do not provide support on programming code.
If the website is offline due to a programming error (for example an error in the .htaccess) we cannot assist. Back to web hosting