Comments on: How to Force HTTPS Using .htaccess (Updated 2024) https://www.hostinger.my/tutorials/ssl/force-https-using-htaccess Thu, 29 Feb 2024 12:18:56 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Ignas R. https://www.hostinger.my/tutorials/ssl/force-https-using-htaccess#comment-666315 Fri, 12 May 2023 08:35:17 +0000 http://blog.hostinger.io/hostinger-tutorials/%category/sslforcing-https/#comment-666315 In reply to PS.

Hello! I would highly suggest changing your .htaccess to a default one and creating the needed redirects via hPanel. If anything, don’t hesitate and contact our support team.

]]>
By: PS https://www.hostinger.my/tutorials/ssl/force-https-using-htaccess#comment-659572 Sun, 07 May 2023 08:10:56 +0000 http://blog.hostinger.io/hostinger-tutorials/%category/sslforcing-https/#comment-659572 Hello,

I have successfully setup ssl. Now https is working find. but still redirect part is not working.

This is how my .httaccess file.

# BEGIN WordPress
# The directives (lines) between “BEGIN WordPress” and “END WordPress” are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.

RewriteEngine on​
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# END WordPress

could you please help me to figure this out?

]]>
By: Vakarė https://www.hostinger.my/tutorials/ssl/force-https-using-htaccess#comment-271898 Tue, 08 Feb 2022 13:04:32 +0000 http://blog.hostinger.io/hostinger-tutorials/%category/sslforcing-https/#comment-271898 In reply to Amit.

Hi Amit, that’s a very good point! If you have setup SSL prior to installing WordPress, it’s best to choose HTTPS. However, if you have not setup SSL prior and try to install WordPress with HTTPS, the new website will not work, so for such a case, it’s best to install on HTTP, then switch to HTTPS after SSL is installed 🙂

]]>
By: Amit https://www.hostinger.my/tutorials/ssl/force-https-using-htaccess#comment-270888 Sat, 05 Feb 2022 13:07:54 +0000 http://blog.hostinger.io/hostinger-tutorials/%category/sslforcing-https/#comment-270888 One thing you can cover in this article which will help lakhs of your customer.
1. What to choose when you install wordpress with your auto installer?
http or https (if you use SSL/if you dont use SSL)
What is good overall?

]]>
By: Vakarė https://www.hostinger.my/tutorials/ssl/force-https-using-htaccess#comment-266030 Tue, 18 Jan 2022 15:44:37 +0000 http://blog.hostinger.io/hostinger-tutorials/%category/sslforcing-https/#comment-266030 In reply to Bassam.

Hi Bassam, you can create the exact same .htaccess file inside of your VPS through SSH. You’ll need to navigate to your website’s public_html folder and create an .htaccess file inside of it.
Alternatively, you can create the redirection for Apache using virtual host – you can find the file inside directory /etc/apache2/sites-available for Ubuntu, then follow this guide 🙂

]]>
By: Bassam https://www.hostinger.my/tutorials/ssl/force-https-using-htaccess#comment-265290 Sat, 15 Jan 2022 15:41:47 +0000 http://blog.hostinger.io/hostinger-tutorials/%category/sslforcing-https/#comment-265290 How can Force HTTPS by SSH , I am using apache2 and ubuntu 20.4

]]>
By: Vakarė https://www.hostinger.my/tutorials/ssl/force-https-using-htaccess#comment-248239 Tue, 12 Oct 2021 14:14:49 +0000 http://blog.hostinger.io/hostinger-tutorials/%category/sslforcing-https/#comment-248239 In reply to Jorge Centeno.

Hi Jorge, what CMS are you using? I’d suggest to double-check the URL structure for your links. Additionally, you might want to temporarily disable the other code inside of your .htaccess file for testing.
Keep us updated how it goes!

]]>
By: Vakarė https://www.hostinger.my/tutorials/ssl/force-https-using-htaccess#comment-248231 Tue, 12 Oct 2021 13:52:51 +0000 http://blog.hostinger.io/hostinger-tutorials/%category/sslforcing-https/#comment-248231 In reply to Sargon Odisho.

Hi, try disabling the current .htaccess files and using this code instead:

Header always set Content-Security-Policy: upgrade-insecure-requests
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Then to create the redirect, make sure to add this:
Redirect 301 /activities-for-men/nsw/S_NSW.php https://www.ecommercelocal.com.au/activities-for-men/liverpol-nsw

]]>
By: Jorge Centeno https://www.hostinger.my/tutorials/ssl/force-https-using-htaccess#comment-247848 Mon, 11 Oct 2021 07:21:22 +0000 http://blog.hostinger.io/hostinger-tutorials/%category/sslforcing-https/#comment-247848 Hello,
Inside the .htaccess I have the following code:
RewriteEngine On
RewriteRule ^ index.php [L]

I am changing it to:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

After this change only the main page works correctly, all the other pages fail with error 404, what would be the issue?

]]>