Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <IfModule mod_rewrite.c>
- RewriteEngine On
- # Gracefully switch between HTTP and HTTPS
- RewriteCond %{HTTPS} =on
- RewriteRule ^(.+)$ - [env=ps:https]
- RewriteCond %{HTTPS} !=on
- RewriteRule ^(.+)$ - [env=ps:http]
- # If requested resource does not exist as a file (or directory)
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- # and does not end with a slash
- RewriteCond %{REQUEST_URI} !/$
- # and does not end with a period followed by a filetype
- RewriteCond %{REQUEST_URI} !\.[^/]+$
- # then add a trailing slash and redirect
- RewriteRule (.*) %{ENV:ps}://%{SERVER_NAME}%{REQUEST_URI}/ [R=302,L]
- </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment