系统:Debian 11
阿帕奇版本:2.4
使用的博客系统:Typecho 1.2
站点文件夹目录权限:755
问题:按照网上搜到的教程配置地址重写后,除了首页和后端外,所有访问的页面都是404。
相关教程。
http://forum.typecho.org/viewtopic.php?t=10782
我使用以下伪静态规则:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
.htaccess 文件与index.php 位于同一目录中。
执行以下操作,也许有效:
mod_rewrite
模块并重新启动:sudo a2enmod rewrite
sudo systemctl restart apache2
AllowOverride All
并重新启动 Apache:<Directory /var/www/html/your-site-dir>
AllowOverride All
</Directory>
sudo systemctl restart apache2
.htaccess
位于站点的根目录中,并具有正确的重写规则。find /path/to/your/site -type d -exec chmod 755 {} \;
find /path/to/your/site -type f -exec chmod 644 {} \;
tail -f /var/log/apache2/error.log
RewriteEngine On
RewriteLogLevel 3
RewriteLog "/var/log/apache2/rewrite.log"
Typecho
兼容且最新,或者作为最后的手段,备份并重新安装 Typecho。sudo systemctl restart apache2
我希望这会起作用......祝你好运,
#阿帕奇时代