chore: scaffold D11 (.htaccess, .ht.router.php, example.gitignore)
Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -44,7 +44,7 @@ if (str_contains($path, '.php')) {
|
|||||||
// fallback to index.php.
|
// fallback to index.php.
|
||||||
do {
|
do {
|
||||||
$path = dirname($path);
|
$path = dirname($path);
|
||||||
if (preg_match('/\.php$/', $path) && is_file(__DIR__ . $path)) {
|
if (str_ends_with($path, '.php') && is_file(__DIR__ . $path)) {
|
||||||
// Discovered that the path contains an existing PHP file. Use that as the
|
// Discovered that the path contains an existing PHP file. Use that as the
|
||||||
// script to include.
|
// script to include.
|
||||||
$script = ltrim($path, '/');
|
$script = ltrim($path, '/');
|
||||||
|
|||||||
+24
-5
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Protect files and directories from prying eyes.
|
# Protect files and directories from prying eyes.
|
||||||
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config|yarn\.lock|package\.json)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
|
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config|yarn\.lock|package(-lock)?\.json)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
|
||||||
<IfModule mod_authz_core.c>
|
<IfModule mod_authz_core.c>
|
||||||
Require all denied
|
Require all denied
|
||||||
</IfModule>
|
</IfModule>
|
||||||
@@ -22,6 +22,9 @@ DirectoryIndex index.php index.html index.htm
|
|||||||
AddType image/svg+xml svg svgz
|
AddType image/svg+xml svg svgz
|
||||||
AddEncoding gzip svgz
|
AddEncoding gzip svgz
|
||||||
|
|
||||||
|
# Add correct encoding for webp.
|
||||||
|
AddType image/webp .webp
|
||||||
|
|
||||||
# PHP settings that cannot be changed at runtime can be set here. See
|
# PHP settings that cannot be changed at runtime can be set here. See
|
||||||
# sites/default/default.settings.php and
|
# sites/default/default.settings.php and
|
||||||
# Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be
|
# Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be
|
||||||
@@ -140,10 +143,7 @@ AddEncoding gzip svgz
|
|||||||
RewriteCond %{REQUEST_URI} !/core/[^/]*\.php$
|
RewriteCond %{REQUEST_URI} !/core/[^/]*\.php$
|
||||||
# Allow access to test-specific PHP files:
|
# Allow access to test-specific PHP files:
|
||||||
RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?\.php
|
RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?\.php
|
||||||
# Allow access to Statistics module's custom front controller.
|
RewriteCond %{REQUEST_URI} !/core/modules/system/tests/modules/legacy_front_controller_test/test_index.php
|
||||||
# Copy and adapt this rule to directly execute PHP files in contributed or
|
|
||||||
# custom modules or to run another PHP application in the same directory.
|
|
||||||
RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics\.php$
|
|
||||||
# Deny access to any other PHP files that do not match the rules above.
|
# Deny access to any other PHP files that do not match the rules above.
|
||||||
# Specifically, disallow autoload.php from being served directly.
|
# Specifically, disallow autoload.php from being served directly.
|
||||||
RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]
|
RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]
|
||||||
@@ -151,11 +151,21 @@ AddEncoding gzip svgz
|
|||||||
# Rules to correctly serve gzip compressed CSS and JS files.
|
# Rules to correctly serve gzip compressed CSS and JS files.
|
||||||
# Requires both mod_rewrite and mod_headers to be enabled.
|
# Requires both mod_rewrite and mod_headers to be enabled.
|
||||||
<IfModule mod_headers.c>
|
<IfModule mod_headers.c>
|
||||||
|
# Serve brotli compressed CSS files if they exist and the client accepts brotli.
|
||||||
|
RewriteCond %{HTTP:Accept-encoding} br
|
||||||
|
RewriteCond %{REQUEST_FILENAME}\.br -s
|
||||||
|
RewriteRule ^(.*css_[a-zA-Z0-9-_]+)\.css$ $1\.css\.br [QSA]
|
||||||
|
|
||||||
# Serve gzip compressed CSS files if they exist and the client accepts gzip.
|
# Serve gzip compressed CSS files if they exist and the client accepts gzip.
|
||||||
RewriteCond %{HTTP:Accept-encoding} gzip
|
RewriteCond %{HTTP:Accept-encoding} gzip
|
||||||
RewriteCond %{REQUEST_FILENAME}\.gz -s
|
RewriteCond %{REQUEST_FILENAME}\.gz -s
|
||||||
RewriteRule ^(.*css_[a-zA-Z0-9-_]+)\.css$ $1\.css\.gz [QSA]
|
RewriteRule ^(.*css_[a-zA-Z0-9-_]+)\.css$ $1\.css\.gz [QSA]
|
||||||
|
|
||||||
|
# Serve brotli compressed JS files if they exist and the client accepts brotli.
|
||||||
|
RewriteCond %{HTTP:Accept-encoding} br
|
||||||
|
RewriteCond %{REQUEST_FILENAME}\.br -s
|
||||||
|
RewriteRule ^(.*js_[a-zA-Z0-9-_]+)\.js$ $1\.js\.br [QSA]
|
||||||
|
|
||||||
# Serve gzip compressed JS files if they exist and the client accepts gzip.
|
# Serve gzip compressed JS files if they exist and the client accepts gzip.
|
||||||
RewriteCond %{HTTP:Accept-encoding} gzip
|
RewriteCond %{HTTP:Accept-encoding} gzip
|
||||||
RewriteCond %{REQUEST_FILENAME}\.gz -s
|
RewriteCond %{REQUEST_FILENAME}\.gz -s
|
||||||
@@ -164,6 +174,8 @@ AddEncoding gzip svgz
|
|||||||
# Serve correct content types, and prevent double compression.
|
# Serve correct content types, and prevent double compression.
|
||||||
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1,E=no-brotli:1]
|
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1,E=no-brotli:1]
|
||||||
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
|
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
|
||||||
|
RewriteRule \.css\.br$ - [T=text/css,E=no-gzip:1,E=no-brotli:1]
|
||||||
|
RewriteRule \.js\.br$ - [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
|
||||||
|
|
||||||
<FilesMatch "(\.js\.gz|\.css\.gz)$">
|
<FilesMatch "(\.js\.gz|\.css\.gz)$">
|
||||||
# Serve correct encoding type.
|
# Serve correct encoding type.
|
||||||
@@ -171,6 +183,13 @@ AddEncoding gzip svgz
|
|||||||
# Force proxies to cache gzipped & non-gzipped css/js files separately.
|
# Force proxies to cache gzipped & non-gzipped css/js files separately.
|
||||||
Header append Vary Accept-Encoding
|
Header append Vary Accept-Encoding
|
||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
|
|
||||||
|
<FilesMatch "(\.js\.br|\.css\.br)$">
|
||||||
|
# Serve correct encoding type.
|
||||||
|
Header set Content-Encoding br
|
||||||
|
# Force proxies to cache compressed & non-compressed css/js files separately.
|
||||||
|
Header append Vary Accept-Encoding
|
||||||
|
</FilesMatch>
|
||||||
</IfModule>
|
</IfModule>
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,10 @@
|
|||||||
/vendor/
|
/vendor/
|
||||||
|
|
||||||
# Ignore configuration files that may contain sensitive information.
|
# Ignore configuration files that may contain sensitive information.
|
||||||
sites/*/settings*.php
|
sites/*/*settings*.php
|
||||||
sites/*/services*.yml
|
!sites/*/default.settings.php
|
||||||
|
sites/*/*services*.yml
|
||||||
|
!sites/*/default.services.yml
|
||||||
|
|
||||||
# Ignore paths that contain user-generated content.
|
# Ignore paths that contain user-generated content.
|
||||||
sites/*/files
|
sites/*/files
|
||||||
@@ -32,7 +34,10 @@ sites/simpletest
|
|||||||
# or delete the previous settings and uncomment the following ones, instead.
|
# or delete the previous settings and uncomment the following ones, instead.
|
||||||
|
|
||||||
# Ignore configuration files that may contain sensitive information.
|
# Ignore configuration files that may contain sensitive information.
|
||||||
# */settings*.php
|
# */*settings*.php
|
||||||
|
# !*/default.settings.php
|
||||||
|
# */*services*.yml
|
||||||
|
# !*/default.services.yml
|
||||||
|
|
||||||
# Ignore paths that contain user-generated content.
|
# Ignore paths that contain user-generated content.
|
||||||
# */files
|
# */files
|
||||||
|
|||||||
Reference in New Issue
Block a user