Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
blog:apache:apache_links [2020/01/13 22:32] tom created |
blog:apache:apache_links [2020/01/26 07:24] (current) tom ↷ Page name changed from blog:apache:links2 to blog:apache:apache_links |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Apache Web Server Links & Tips ====== | ====== Apache Web Server Links & Tips ====== | ||
+ | |||
+ | ====== Links ====== | ||
* [[https://httpd.apache.org/docs/current/|Apache Documentation]] | * [[https://httpd.apache.org/docs/current/|Apache Documentation]] | ||
Line 6: | Line 8: | ||
* [[https://www.askapache.com/htaccess/http-https-rewriterule-redirect/|Smart HTTP and HTTPS .htaccess Rewrite]] | * [[https://www.askapache.com/htaccess/http-https-rewriterule-redirect/|Smart HTTP and HTTPS .htaccess Rewrite]] | ||
* [[http://httpd.apache.org/docs/current/upgrading.html|Upgrade Tips]] | * [[http://httpd.apache.org/docs/current/upgrading.html|Upgrade Tips]] | ||
+ | |||
+ | ====== Tips ====== | ||
+ | |||
+ | ===== Redirect to https if the request is not from localhost ===== | ||
+ | |||
+ | <code > | ||
+ | RewriteEngine On | ||
+ | RewriteCond %{HTTPS} !on | ||
+ | RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$ | ||
+ | RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,QSA] | ||
+ | </code> | ||
{{tag>apache}} | {{tag>apache}} |