Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

Force HTTPS

Nikolas Branis   ( User )

Commented 6 years ago

If you are running Akaunting on a www.example.com domain:


<IfModule mod_rewrite.c>


RewriteEngine on


RewriteCond %{HTTPS} off [OR]


RewriteCond %{HTTP_HOST} !^www\. [NC]


RewriteRule (.*) https://www.example.com%{REQUEST_URI} [NE,L,R=301]


</IfModule>


 


If you are running Akaunting on a app.example.com subdomain:


<IfModule mod_rewrite.c>


RewriteEngine On


RewriteCond %{HTTPS} off


RewriteRule ^(.*)$ https://app.example.com%{REQUEST_URI} [L,R=301]


RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]


RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]


 


</IfModule>

Nikolas Branis   ( User )

Commented 6 years ago

If you are running Akaunting on a example.com domain:
<code>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule (.*) https://example.com%{REQUEST_URI} [R=301,L]
</IfModule>
<code>

Denis Dulici   ( Admin )

Commented 6 years ago

You may try this: http://stackoverflow.com/a/28403907/610880


Will consider to add to the next version.

Nikolas Branis   ( User )

Commented 6 years ago

Thanks for the update Denis.
As I am not very familiar (yet) with Laravel I just want to make sure it's a 301 Moved Permantly redirect and not a 302 Found.

Monero Jeanniton   ( User )

Commented 4 years ago

This worked for me:
http://stackoverflow.com/a/28403907/610880

Gbenga Gbenga   ( User )

Commented 1 year ago

Thanks, the below you provide work for me.




RewriteEngine On


RewriteCond %{HTTPS} off


RewriteRule ^(.*)$ https://app.example.com%{REQUEST_URI} [L,R=301]


RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]


RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]







Please login or register to leave a response.

Showing 1 to 6 of 6 discussions