Https SSL Certificat help
Good day.
I use Xara Web Designer 11 Premium. I have created a website www.sosd.sk
The service provider created an SSL certificate for me, and I have to redirect it in the .htaccess file
RewriteEngine On
RewriteCond% {SERVER_PORT} 80
RewriteRule ^ (. *) $ Https://www.yourdomain.com/$1 [R, L]
Can anyone write me the exact procedure where I should insert it? I can't handle it. I'm done.
Thank you for any advice and help.
Re: Https SSL Certificat help
The.htaccess file goes in the same place as your htm page files and your index_htm_files folder. This is typically the public_html folder.
There are multiple ways to upload via ftp, and a small, singular file like the .htaccess should be quick and easy.
Re: Https SSL Certificat help
I think you also have to change https://www.yourdomain.com/$1 [R, L to https://www.sosd.sk/$1 [R, L and I would make the h in https in lowercase.
Re: Https SSL Certificat help
The offered code is messy.
apache.org uses RewriteCond %{HTTPS} off instead of RewriteCond% {SERVER_PORT} 80
You currently have https://sosd.sk as well as https://www.sosd.sk.
Look at https://linuxize.com/post/htaccess-force-https/ where the required redirects are fairly well explained.
Do avoid repeating RewriteEngine On in the same .htaccess file.
The rewrite code can be added before any existing .htaccess blocks.
I would start off with:
RewriteEngine On
# Do not have this repeat elsewhere
RewriteCond %{HTTPS} off [OR]
# This checks to make sure the connection is not already HTTPS
# - [OR] is an operator that informs the next line is also a conditional check
RewriteCond %{HTTP_HOST} ^sosd.sk [NC]
# This check the visitor has made the call without the www. prefix
# - [NC] is the No Case Flag so the call and be lower, upper or mixed case
RewriteRule ^(.*)$ https://www.sosd.sk/$1 [R=301,L]
# [R=301] - The Redirect Flag sets all HTTP requests to HTTPS, with status code 301 (Moved Permanently)
# - [L] - The Last Flag locks the URL from being changed by any following code (speeds processing)
The green comment lines can be removed.
Acorn
Re: Https SSL Certificat help
Below are 2 texts that you will insert into the htaccess file and it will be in the root of your web hosting.
czech translate: Dole jsou 2 texty, které vložíš do htaccess souboru a ten bude v rootu tvého webhostingu.
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301]
Header set Content-Security-Policy "upgrade-insecure-requests;"
OR
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,NE,L]
Re: Https SSL Certificat help
I still don't understand it.
Will I put this in Notepad as .htaccess.txt and copy it to the server?
RewriteEngine On
RewriteCond% {HTTPS} off [OR]
RewriteCond% {HTTP_HOST} ^ sosd.sk [NC]
RewriteRule ^ (. *) $ Https://www.sosd.sk/$1 [R = 301, L]
Should it show up as a secure site right away?
Re: Https SSL Certificat help
When I write https://www.sosd.sk in chrome, it gives me a lock and writes that the site is secure. But when I give www.sosd.sk, he writes to me that the site is not secure.
Re: Https SSL Certificat help
save your notepad file as .htaccess no more no less. Exactly that. Put it in the root folder where your index.htm is.
1 Attachment(s)
Re: Https SSL Certificat help
I Inserted:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} folder
RewriteRule ^(.*)$ https://www.sosd.sk/folder/$1 [R,L]
but it still doesn't work.Attachment 131407
Re: Https SSL Certificat help
This works for mine. I have put your site details in.
Make the text below into a .htaccess file and delete the old one. Upload it. That should work.
RewriteEngine On
RewriteCond %{HTTP_HOST} sosd.sk [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.sosd.sk/$1 [R,L]
Re: Https SSL Certificat help
Re: Https SSL Certificat help
Re: Https SSL Certificat help
Re: Https SSL Certificat help
Re: Https SSL Certificat help
Here's what I use in my .htaccess file.
Quote:
#Rewrite everything to https
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
There's no specific domain name required. It's not my code but it works well in redirecting any 'normal' url to the https site.
my-site.com redirects to https:my-site.com
www.my-site.com redirects to https:my-site.com
http://my-site.com redirects to https:my-site.com
etc.
Re: Https SSL Certificat help
Quote:
Originally Posted by
Egg Bramhill
Here's what I use in my .htaccess file.
There's no specific domain name required. It's not my code but it works well in redirecting any 'normal' url to the https site.
my-site.com redirects to https:my-site.com
www.my-site.com redirects to https:my-site.com
http://my-site.com redirects to https:my-site.com
etc.
I would just like to put on record how useful this advice was, saving me hours. This forum is my go to site when problems arise on the basis that I probably won't be the first to encounter a problem and that someone has probably already solved it.
Thank you to the problem solvers!
Edited to point out that the missing bit in the quote (the useful bit) is in the previous posting.
Re: Https SSL Certificat help