0

System: Debian 11

Apache version: 2.4

Blogging system used: Typecho 1.2

Site folder directory permissions: 755

The problem: After configuring the address rewrite according to the tutorials searched on the web, all the pages visited are 404 except for the home page and backend.

Related tutorials.

http://forum.typecho.org/viewtopic.php?t=10782

How to enable mod_rewrite for Apache 2.2

I use the following pseudo-static rules:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

The .htaccess file is in the same directory as index.php.

OwO233
  • 1
  • Does removing the leading slash from the `RewriteRule` work? IE: `RewriteRule ^(.*)$ index.php/$1 [L]` – midnight-coding Feb 19 '22 at 15:43
  • Thank you very much for the suggestion, it's a nice try. But when I removed the slash, my blog post screen still remains 404. – OwO233 Feb 19 '22 at 16:07
  • Do you need the `RewriteBase` line? Try removing that line altogether and then trying again. If that does not work then add the forward slash back in on the `RewriteRule`. .htaccess rules are tricky things. Is this .htaccess file located at the root of your public directory? If this does not work then back to basics, is `mod_rewrite` enabled in your Apache config file(s). On Debian try typing `apache2ctl -V` at the command line to find the config file(s) used, then view / search them to ensure `mod_rewrite` has been uncommented. IE: No leading # – midnight-coding Feb 19 '22 at 23:56
  • @midnight-coding I've tried this action but it's not working and I'm ready to switch to using a static blog template. Thank you for all the help you have given me. – OwO233 Feb 20 '22 at 13:11

0 Answers0