-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
37 lines (31 loc) · 929 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
# Enable RewriteEngine
RewriteEngine On
php_flag display_errors off
# Disable files and directories index listing
Options -Indexes
DirectoryIndex index.php
# Deny all files except index.php and specified extensions
<FilesMatch "^(?!index\.php$).*\.(?!css|js|jpe?g|png|gif$)[^.]+$">
Order Deny,Allow
Deny from all
</FilesMatch>
# Allow access to all PHP files
<FilesMatch "\.php$">
Order Allow,Deny
Allow from all
</FilesMatch>
# Allow access to PHP files in public folder without .php extension
<FilesMatch "^public/.*\.php$">
Order Allow,Deny
Allow from all
</FilesMatch>
# Allow access to sitemap
<FilesMatch "sitemap.xml">
Order Allow,Deny
Allow from all
</FilesMatch>
# Route all requests to index.php except for existing files and directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index\.php$
RewriteRule ^ /index.php [L]