aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-07-29 00:34:02 +0200
committerThomas Lange <code@nerdmind.de>2021-07-29 00:34:02 +0200
commit6c20227d7e65d55f8a64e7992f5013ffeab81d0d (patch)
tree63138284a4598aad0277be9ede70192ca9eaaa30
parentb605b73bbd0eaf314803b6c8c28bff000878d84c (diff)
downloadblog-6c20227d7e65d55f8a64e7992f5013ffeab81d0d.tar.gz
blog-6c20227d7e65d55f8a64e7992f5013ffeab81d0d.tar.xz
blog-6c20227d7e65d55f8a64e7992f5013ffeab81d0d.zip
Update the Apache and nginx configuration files
-rw-r--r--.ht-nginx18
-rw-r--r--.htaccess29
2 files changed, 27 insertions, 20 deletions
diff --git a/.ht-nginx b/.ht-nginx
index 6b97cb8..ba8a9b2 100644
--- a/.ht-nginx
+++ b/.ht-nginx
@@ -1,16 +1,22 @@
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
-# nginx configuration rules [Thomas Lange <code@nerdmind.de>] #
+# nginx configuration [Thomas Lange <code@nerdmind.de>] #
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
# #
# This file contains the configuration from the Apaches .htaccess file written #
# for the nginx high performance web server. Put the content of this file into #
# the "server {}" block of your nginx virtual host configuration file. If your #
-# blog installation is within a sub directory, you need to adjust this values! #
+# blog is installed in a sub directory, you might need to adjust this rules! #
+# #
+# How to setup PHP and passing requests via FastCGI to PHP-FPM is your job. If #
+# you encounter a "403 Forbidden" error on the home page, please make sure you #
+# have configured your nginx virtual host to look for an index.php file: #
+# #
+# index index.php [...]; #
# #
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
#===============================================================================
-# Error documents
+# Error pages
#===============================================================================
error_page 403 /403.php;
error_page 404 /404.php;
@@ -23,8 +29,6 @@ location ~ ^/(.git|core|theme/([^/]+)/(html|lang)/) {
}
#===============================================================================
-# Main rules
+# Pass requests to index.php
#===============================================================================
-if (!-e $request_filename) {
- rewrite ^(.*)$ /index.php break;
-}
+try_files $uri $uri/ /index.php?$args;
diff --git a/.htaccess b/.htaccess
index b3203b2..e337dde 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1,24 +1,28 @@
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
-# Apache configuration rules [Thomas Lange <code@nerdmind.de>] #
+# Apache configuration [Thomas Lange <code@nerdmind.de>] #
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
# #
-# This file contains rewrite rules for Apache. It's recommended to include the #
-# rules directly into your Apache configuration for a better performance. Also #
-# disable the AllowOverride directive within your Apache virtualhost (if it is #
-# not already globally disabled for performance and security reasons both). #
+# This file contains the configuration rules for the Apache HTTP server. It is #
+# recommended to include these rules directly into the Apache configuration! #
+# #
+# Additionally, it's recommended to ensure that the AllowOverride directive is #
+# disabled if these rules are included in the Apache configuration. Otherwise, #
+# the Apache HTTP server is checking for .htaccess files on every request. #
+# #
+# AllowOverride None #
# #
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
#===============================================================================
-# Enable RewriteEngine
+# Error pages
#===============================================================================
-RewriteEngine On
+ErrorDocument 403 /403.php
+ErrorDocument 404 /404.php
#===============================================================================
-# ErrorDocument handler
+# Enable RewriteEngine
#===============================================================================
-ErrorDocument 403 /403.php
-ErrorDocument 404 /404.php
+RewriteEngine On
#===============================================================================
# Forbidden directories
@@ -26,9 +30,8 @@ ErrorDocument 404 /404.php
RewriteRule ^(.git|core|theme/([^/]+)/(html|lang)/) - [F]
#===============================================================================
-# Main rules
+# Pass requests to index.php
#===============================================================================
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
-
-RewriteRule ^(.*)$ index.php [L]
+RewriteRule . index.php [L]