【发布时间】:2017-10-10 13:06:53
【问题描述】:
当 URL 包含某个字符串时,我想用 htaccess 重写我的 url。
例子:
My url : example.com/information
当“信息”在我的 url 中时,我想重写我的 information.php 文件。 希望有人能帮帮我。
【问题讨论】:
标签: .htaccess url url-rewriting
当 URL 包含某个字符串时,我想用 htaccess 重写我的 url。
例子:
My url : example.com/information
当“信息”在我的 url 中时,我想重写我的 information.php 文件。 希望有人能帮帮我。
【问题讨论】:
标签: .htaccess url url-rewriting
试试这个:
RewriteCond %{REQUEST_URI} !/information\.php$
RewriteRule information information.php [L]
此规则会将任何在 URL 路径中包含“信息”的请求重写为同一目录中的 information.php。
【讨论】: