.htaccess (redirection)

.htaccess is a file that contains redirections such as http to https, or broken links to a custom 404 page.
This page provides a simple procedure for creating and installing such a file on your website.

".htaccess" is the name of the file as it exists in your root folder.
You change the filename to "htaccess.txt" to edit it using Windows' 'notepad' (or similar).

htaccess.txt

1) open notepad (or equivalent)

2) type the following in notepad:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://www.????????.com [R=301,L]

note: the url address "www.????????.com" is that of your website
you use "https:" if you have a valis SSL certificate, otherwise, use "http:"

3) save the text file on your desktop with the filename "htaccess.txt"

4) close notepad

5) change the name of the file to ".htaccess"

6) drag-and-drop the ".htaccess" file into your root folder
note: your root folder is the one where all of your files and folders are kept, e.g.; "ftp://ftp.????????.com/wwwroot/"

Each time you wish to edit this file, you drag it back onto your desktop, change the filename back to "htaccess.txt" and do so using notepad.
When you have finished editing, you repeat steps 3) to 6) above.

You will add any other redirections, such as to a custom 404 file into this file. For example:
You create your 404 page, name it "404.html" and put it in your root folder (the same as 6) above)
You then add the following line of code in the ".htaccess" file (editing it as described in 1) to 6) above)
"ErrorDocument 404 [Tab] /404.html"
note: [Tab] simply refers to a tab-space

Our Other Coding Pages:

.html; .css; .js; SEO

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -