mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
40 lines
1019 B
ApacheConf
Executable File
40 lines
1019 B
ApacheConf
Executable File
<IfModule mod_rewrite.c>
|
|
|
|
RewriteEngine On
|
|
|
|
##
|
|
# If you are getting 404 errors on subpages, you may have to uncomment the RewriteBase entry
|
|
# You should change the '/' to your appropriate subfolder. For example if you have
|
|
# your Grav install at the root of your site '/' should work, else it might be something
|
|
# along the lines of: RewriteBase /<your_sub_folder>
|
|
##
|
|
|
|
# RewriteBase /
|
|
|
|
# Access site
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteRule .* index.php [L]
|
|
|
|
# Block various user files from being accessed directly
|
|
RewriteRule ^user/accounts/(.*)$ error [R=301,L]
|
|
RewriteRule ^user/config/(.*)$ error [R=301,L]
|
|
RewriteRule ^user/(.*)\.(txt|md|html|php|yaml|json|twig|sh|bat)$ error [R=301,L]
|
|
|
|
# Block cache/
|
|
RewriteRule ^cache/(.*) error [R=301,L]
|
|
|
|
# Block bin/
|
|
RewriteRule ^bin/(.*)$ error [R=301,L]
|
|
|
|
# Block system/
|
|
RewriteRule ^system/(.*)$ error [R=301,L]
|
|
|
|
# Block vendor/
|
|
# RewriteRule ^vendor/(.*)$ error [R=301,L]
|
|
|
|
</IfModule>
|
|
|
|
# Prevent file browsing
|
|
Options -Indexes
|