From bca1e88fbdf4c74ec51f5135ef2b7a6261ccb1d6 Mon Sep 17 00:00:00 2001 From: Bizley Date: Wed, 5 Dec 2018 11:20:35 +0100 Subject: [PATCH] Fix Apache URL rewriting (#16936) --- docs/guide/start-installation.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/guide/start-installation.md b/docs/guide/start-installation.md index caac601f0e..e8d9eed8ec 100644 --- a/docs/guide/start-installation.md +++ b/docs/guide/start-installation.md @@ -218,15 +218,17 @@ DocumentRoot "path/to/basic/web" # use mod_rewrite for pretty URL support RewriteEngine on + + # if $showScriptName is false in UrlManager, do not allow accessing URLs with script name + RewriteRule ^index.php/ - [L,R=404] + # If a directory or a file exists, use the request directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d + # Otherwise forward the request to index.php RewriteRule . index.php - # if $showScriptName is false in UrlManager, do not allow accessing URLs with script name - RewriteRule ^index.php/ - [L,R=404] - # ...other settings... ```