我最近在 .htaccess 文件中不再使用它
RewriteRule ^example index.php?page=example [L]
对此:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^./]+)/?$ index.php?page=$1 [L,QSA]
问题是,如果我访问 example.com/euffhfrfreif 之类的东西 - 它只会显示我的主页。
我正在尝试配置虚 URL,以便访问者不会使用 example.com/index.php?page=contact,而只是访问 example.com/contact - 我在网上看到了很多,它应该对谷歌等更好。
此错误不适用于任何文件夹,因此访问 example.com/djfhds/fdjdnf 将显示 404 错误。
我怎样才能恢复我的 404 错误但保留(或保留类似的东西)我的新系统?
另外:我有 rewriteengine 和 .htaccess 中定义的 404 错误页面。