-
Notifications
You must be signed in to change notification settings - Fork 6
/
.htaccess
23 lines (17 loc) · 660 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
RewriteEngine On
# Hide files and folders starting with a dot
RewriteRule (^|/)\.(.*)$ - [F]
# If the requested URL is a directory
RewriteCond %{REQUEST_FILENAME} -d
# And if the directory does not contain an index file
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.htm !-f
RewriteCond %{REQUEST_FILENAME}/index.shtml !-f
RewriteCond %{REQUEST_FILENAME}/index.cgi !-f
# Then return a 403 Forbidden error
RewriteRule ^ - [F]
# If the requested URL is not a file
RewriteCond %{REQUEST_FILENAME} !-f
# Then rewrite the URL to index.php
RewriteRule ^(.*)$ index.php [QSA,L]