-
Notifications
You must be signed in to change notification settings - Fork 2
/
.htaccess
40 lines (32 loc) · 896 Bytes
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
DirectoryIndex hyblog.php
<Files config.php>
Order Deny,Allow
Deny from all
</Files>
<FilesMatch ".(jpg|jpeg|png|webp|js)$">
Header set Cache-Control "max-age=2629746, public"
</FilesMatch>
<FilesMatch ".(css)$">
Header set Cache-Control "max-age=100, public"
</FilesMatch>
<FilesMatch ".(xml)$">
<ifModule mod_headers.c>
AddDefaultCharset UTF-8
Header set Content-Type "application/xml"
Header set x-content-type-options "nosniff"
</ifModule>
</FilesMatch>
# BEGIN Redirection
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# ErrorDocument 404 /404.php
# Get the folder name dynamically
RewriteCond %{REQUEST_URI} ^/(.+?)/
RewriteRule .* - [E=FOLDER_NAME:%1]
# Set the custom 404 error document
ErrorDocument 404 /%{ENV:FOLDER_NAME}/404.php
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301]
</IfModule>
# END Redirection