RewriteEngine on RewriteOptions MaxRedirects=1 RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^([a-zA-Z0-9_-]+)$ ?fh=Shortchain&uid=$1 [L]

你可以在你的 Apache 配置文件中添加以下代码来定义一个自定义的 404 错误页面:

ErrorDocument 404 /404.html

请确保将 '404.html' 替换为你实际的错误页面文件路径。你可以将该文件放置在你的网站根目录下,或者在其他地方,只需相应地更新路径。

完整代码如下:

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteOptions MaxRedirects=1
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^([a-zA-Z0-9_-]+)$ ?fh=Shortchain&uid=$1 [L]
</IfModule>

ErrorDocument 404 /404.html
Apache 伪静态规则及自定义 404 错误页面

原文地址: https://www.cveoy.top/t/topic/PTq 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录