2
0
Fork 0
mirror of https://github.com/phanan/htaccess.git synced 2018-11-08 13:39:40 +01:00

adds force http snippet

This commit is contained in:
Mason Wiley 2015-02-09 22:45:43 -08:00
parent fff8f8a1e9
commit e1e303d3f8

View file

@ -12,6 +12,7 @@ A collection of useful .htaccess snippets, all in one place. I decided to create
- [Force non-www](#force-non-www)
- [Force HTTPS](#force-https)
- [Force HTTPS Behind a Proxy](#force-https-behind-a-proxy)
- [Force HTTP](#force-http)
- [Force Trailing Slash](#force-trailing-slash)
- [Redirect a Single Page](#redirect-a-single-page)
- [Redirect an Entire Site](#redirect-an-entire-site)
@ -78,6 +79,13 @@ RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
```
### Force HTTP
``` apacheconf
RewriteEngine on
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
```
### Force Trailing Slash
``` apacheconf
RewriteCond %{REQUEST_URI} /+[^\.]+$