OS: Ubuntu 22, Apache2 has beeen installed

enabled rewrite

sudo a2enmod rewrite

add .htaccess to replace index.php

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php/$1 [L]
RewriteRule ^(.*)$ index.php [E=PATH_INFO:$1,QSA,PT,L]
</IfModule>

# Disable directory browsing
Options -Indexes

标签: apache2, 服务器

评论已关闭