Forum Moderators: phranque

Message Too Old, No Replies

how to create a .htaccess file

.htaccess file

         

comdini

4:35 pm on Jan 26, 2011 (gmt 0)

10+ Year Member



I've a requirement to direct http:// URL to https:// . So I saw many guides for this. it has mentioned that to create a .htaccess file. How can i create it ? Else Already if it created , how can i find the exact path .

Samizdata

5:44 pm on Jan 26, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



An .htaccess file can be created with any text editor that can save in plain text (e.g. Notepad).

It has no filename - just the .htaccess extension - and for that reason is likely to be "invisible" on a standard computer. One way to deal with this is to save it with any name you want, upload it to the webserver then rename it ".htaccess".

For sitewide effect place the file in the web root. Note that an .htaccess file can be placed in any directory, and a secondary .htaccess file can be used to modify the directives in the root file insofar as they effect that directory.

The .htaccess file is designed to override (where allowed) your Apache configuration and is extremely powerful - the slightest mistake can take your website offline, so proceed with caution while you educate yourself and always check the site after making any .htaccess changes.

There's plenty of information in this forum.

...

g1smd

6:03 pm on Jan 26, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




Be aware that many FTP programs do not list filenames beginning with a dot, so make sure that you unset that option first, so that you can be sure you are not overwriting an existing .htaccess file the first time you upload yours.


Create it as htaccess.txt, upload it using FTP, then rename it to .htaccess using FTP.