Did we help you in something? If so, we would very much appreciate if you Share our website or forums link. Thank you!

[Solved] Redirect all Osclass http to https  

  RSS
BoS
 BoS
(@bos)
Active Member

Hello.

I try to redirect all non secure http to https in my Osclass but it doesn't seem to work. I used some scripts i found on the Internet but no luck.

Does Osclass need something special?

Thanks

This topic was modified 2 months ago by Editor
Quote
Posted : November 25, 2019 14:55
Topic Tags
Editor
(@editor)
Reputable Member Moderator

The problem is not Osclass but different hosting.

Try this in your .htaccess above the standard Osclass mod rewrite code:

 

#SSL START 
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourwebsite.tld/$1 [R=301,L]
#SSL END

 

If this doesn't work for you, let me know and i will post more solutions.

 

This post was modified 2 months ago by Editor
ReplyQuote
Posted : November 25, 2019 15:24
Editor
(@editor)
Reputable Member Moderator

If the above doesn't work for you, try this:

 

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
This post was modified 2 months ago by Editor
ReplyQuote
Posted : November 25, 2019 17:07
Editor
(@editor)
Reputable Member Moderator

and for Nginx in your config file:

 

server {
listen 80;
server_name domain.com www.domain.com;
return 301 https://domain.com$request_uri;
}
ReplyQuote
Posted : November 25, 2019 17:09
BoS
 BoS
(@bos)
Active Member

Thanks a lot.

I was trying to use the second and didn't seem to work. But the fist one of your reply seems to work just fine.

Cheers.

ReplyQuote
Posted : November 25, 2019 18:07
Share:

Please Login or Register