php - .htaccess 在匹配包含 URL 中的单词时调用特定页面
问题描述
我怀疑如何创建包含特定单词的页面 url 的 .htaccess 以使用 index.php 中的性能。
我的意思不是将 301 重定向到 index.php。
但我想访问诸如 /my-account/lost-password/index.html 或 /my-account/create/index.html 之类的 url。当访问这两个 url 时,它会被称为 index.php 中的内容,而不会重定向到 index.php。
是否可以编写 .htaccess 来满足上述要求?
谢谢
解决方案
你的意思是这样的?
RewriteEngine On
RewriteCond %{REQUEST_URI} /lost-password/index.html
RewriteRule . index.php [L]
假设您将其放在文件my-account
夹中的 htaccess 文件中。
推荐阅读
- c# - .NETCore 3.1 覆盖 docker compose 中的自定义值
- azure-logic-apps - PowerAutomate:有没有办法通过接收不同邮箱的邮件来触发触发器
- django - GIS - 我可以在 1 个模型中有多个 geo_fields(点、多边形、线)然后用 DRF 序列化吗?
- javascript - 循环类后从元素中检索元素CSS属性?
- c# - VSTO:自动更正添加条目未按预期工作
- ios - iOS 应用程序在更新到新版本和新的 firebasedb 后崩溃
- ios - 如何在 Swift 框架中使用 Obj-C 框架代码?
- performance - 如何正确部署kafka监控代理?
- jmeter - jmeter 报告详细信息问题:显示不正确的计数
- javascript - [已解决]如何取消“引导模式”退出行为?