Options -Indexes
RewriteEngine On
RewriteBase /
# or /folder1/folder2/
# Remove www (redirect non-www)
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# Redirect all insecure requests
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]
# tell web browsers not to even try HTTP on this domain for the next year
# uncomment this only after you've confirmed your site is working on HTTPS, since it commits you to providing it over HTTPS
#Header set Strict-Transport-Security "max-age=31536000" env=HTTPS
#Header unset Strict-Transport-Security
RedirectMatch 403 ^/?s/(.*)\.php$
RedirectMatch 403 ^/?chat/(.*)\.log$
RewriteRule ^/?d/(.*)$ /dl.php?p=$1 [NC,L]
# or /folder1/folder2/dl.php?...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ /index.php?p=$1 [NC,L]
RewriteRule ^(.*)$ /index.php?p=$1 [B,NC,L]
# or /folder1/folder2/index.php?...
Top