Page 1 of 1

.htaccess

Posted: Sun May 23, 2021 5:01 am
by davehappen
Hi all, I've just got some software for hosting my own web sites, which works and comes with ssl (https://)status. I have to upload my sites as html. but to get the https:// i havew to add a .htaccess. where would i add that??????
TIA
Dave

Re: .htaccess

Posted: Sun May 23, 2021 5:11 am
by wb_user
davehappen wrote: Sun May 23, 2021 5:01 am Hi all, I've just got some software for hosting my own web sites, which works and comes with ssl (https://)status. I have to upload my sites as html. but to get the https:// i havew to add a .htaccess. where would i add that??????
TIA
Dave
try to use this
# Redirect HTTP to HTTPS
RewriteCond %{HTTP:X-Forwarded-Proto} =https
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Re: .htaccess

Posted: Sun May 23, 2021 5:14 am
by davehappen
I have the script but am unsure where to insert it.
(head, body, tag, end)??????

Re: .htaccess

Posted: Sun May 23, 2021 5:26 am
by wb_user
davehappen wrote: Sun May 23, 2021 5:14 am I have the script but am unsure where to insert it.
(head, body, tag, end)??????
no, you should set this code in .htaccess
.htaccess located in your Hosting service. (cpanel - direct admin)

Re: .htaccess

Posted: Sun May 23, 2021 5:51 am
by BaconFries
The .htacces file code does not get inserted in the page html. You will need to either create it locally with the likes of Notepad++ or just Notepad and then upload to your server. You can also create on the server itself to which your host should assist you with this. Note there is no file extension associated with it it is just .htacces nothing else.

To create locally open Notepad and add the code provided now select File name -> rename to .htaccess Save As type->
then choose "All Files" as the type - this will then create the .htaccess file for you. You can now upload to your server.
Please note this is unrelated to the program and its use. Also to be able to use you should check that your host supports Apache otherwise it will not work.

Image

Re: .htaccess

Posted: Sun May 23, 2021 6:21 am
by davehappen
cheers bacon, il'll try it and let you know if it works

Re: .htaccess

Posted: Sun May 23, 2021 6:41 am
by davehappen
hi bacon , yes, just uploaded to site, works a treat, many thanks to all.

Re: .htaccess

Posted: Sun May 23, 2021 6:49 am
by BaconFries
Glad to have helped..credit to wb_user as well for his input.