0

Hello and sorry about my english, im german! I found this htaccess on github: https://gist.github.com/HechtMediaArts/ad6cb1f190279f9eca7d

I would like to force the url to https? Which part of code i have to change? Thanks a lot for reading!

On How to redirect all HTTP requests to HTTPS is a similar question, but i cant use it. I dont know which part of code i have to cancel to use it for my site.

Community
  • 1
  • 1
  • Do you have embedded links in your code with http://blahblahblah.... or does the code all use relative paths like /lib/blah/blah? If you have embedded http:// in the code, that will need to be fixed first. Otherwise it's relatively straight forward: https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-12-04 – the happy mamba Mar 15 '16 at 23:39
  • Possible duplicate of [How to redirect all HTTP requests to HTTPS](http://stackoverflow.com/questions/4083221/how-to-redirect-all-http-requests-to-https) – alexw Mar 15 '16 at 23:42
  • No alex, that is not a duplicate. I tried to find the part, which i should change, but i cant. On your link i see the code, but which i have to change? Thats my question! – Snoozlebug Mar 15 '16 at 23:48
  • I tried also to add your code from the link, but that doesnt work. – Snoozlebug Mar 15 '16 at 23:49

1 Answers1

0

I found the Solution: Between the Lines 166 and 167 insert this Code:

# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Thanks to all!