File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
RewriteEngine On
2
2
3
+ # Hide files and folders starting with a dot
4
+ RewriteRule (^|/)\.(.*)$ - [F]
5
+
3
6
# If the requested URL is a directory
4
7
RewriteCond %{REQUEST_FILENAME} -d
5
8
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ location / {
13
13
if (-f $request_filename /index.htm) {
14
14
set $no_index 0 ;
15
15
}
16
+ if (-f $request_filename /index.cgi) {
17
+ set $no_index 0 ;
18
+ }
16
19
if (-f $request_filename /index.shtml) {
17
20
set $no_index 0 ;
18
21
}
@@ -30,6 +33,13 @@ location / {
30
33
rewrite ^(.*)$ /index.php?$query_string last ;
31
34
}
32
35
36
+ # Hide files and folders starting with a dot
37
+ location ~ /\. {
38
+ deny all ;
39
+ access_log off ;
40
+ log_not_found off ;
41
+ }
42
+
33
43
# Serve the requested file
34
44
try_files $uri $uri / =404 ;
35
45
}
You can’t perform that action at this time.
0 commit comments