Enabling URL Rewriting in Typecho and Hiding index.php

Machine-translated (anthropic, claude-haiku-5-5) from the Chinese original. Read the original in 中文

Typecho permalinks show index.php after the domain

For example:

https://xsiy.top/blog/index.php/about.html

How do I fix this?

First, add a .htaccess rewrite file to the Typecho root directory with the code below, then enable URL rewriting in the permalink settings in the admin backend.

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

Comments