Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RewriteEngine On
- RewriteBase /folder/
- RewriteCond %{HTTPS} off
- RewriteRule ^(.*)$ https://www.example.com/folder/$1 [R=301,L]
- <FilesMatch "file.php">
- <If "%{HTTPS} == 'on' && %{REMOTE_ADDR} != '1.2.3.4'">
- AuthType Basic
- AuthName "Password Required"
- AuthUserFile /home/example/public_html/folder/.htpasswd
- Require valid-user
- ErrorDocument 401 "Authorisation Required"
- </If>
- </FilesMatch>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement