-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.htaccess
More file actions
24 lines (18 loc) · 737 Bytes
/
.htaccess
File metadata and controls
24 lines (18 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Turn on rewriting.
RewriteEngine On
# Base directory of the rewrite rules
RewriteBase /project1211/
# Redirect requests to the 'dist' directory without changing the URL in the address bar
RewriteCond %{REQUEST_URI} !^/project1211/dist/
RewriteRule ^(.*)$ dist/$1 [L,QSA]
# Prevent access to 'config' directory and its contents.
RewriteCond %{SCRIPT_FILENAME} /config/
RewriteRule ^.*$ - [F,L]
# Prevent direct access to .php files in the 'config' directory.
RewriteCond %{THE_REQUEST} /config/.*\.php [NC]
RewriteRule ^ - [F]
# Alternatively, block access to all .php files in the project (excluding 'dist')
RewriteCond %{REQUEST_URI} !^/project1211/dist/
RewriteRule \.php$ - [F,L]
# Prevent directory listings
Options -Indexes