.htaccess - PhpStorm 在做代码分析时能否解析.htaccess 中的mod_rewrite 规则?

标签 .htaccess mod-rewrite phpstorm

我的 PHP 项目中有一堆 mod_rewrite 规则。当我提交到 git 时,PhpStorm 对我提交的内容运行代码分析,这很好,但它会产生一堆警告,因为链接指向重写的 URL,而不是实际的 PHP 文件,例如:

Warning:(103, 71) Cannot resolve file 'contact'

对于这样的链接:

<a href="/contact">get in touch</a>

有没有办法让 PhpStorm 解析我的 .htaccess 文件中的重写规则?如果做不到这一点,我该如何关闭此检查?我尝试取消选中 Preferences > Editor > Inspections > HTML > Anchor reference problems 但我仍然收到警告。

最佳答案

Is there a way to make PHPStorm resolve the rewrite rules in my .htaccess file?

没有。

https://youtrack.jetbrains.com/issue/WI-1032 -- 观看这张票(星号/投票/评论)以获得进度通知。

Failing that, how do I turn this inspection off? I've tried unchecking Preferences > Editor > Inspections > HTML > Anchor reference problems but I'm still getting the warnings.

正确的是“Inspections | HTML | File reference problems”

关于.htaccess - PhpStorm 在做代码分析时能否解析.htaccess 中的mod_rewrite 规则?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28931809/

相关文章:

javascript - 方法表达式不是函数类型

php - 带有完整路径和查询的 http 到 https [apache]

node.js - PhpStorm/WebStorm node_modules 和 package.json

php - 寻找重写特定 URL 的指导

regex - 如何使 mod_rewrite 从子域重定向到查询字符串?

Apache 重写规则前导斜杠

php - 使用 mod_rewrite 在 htaccess 中为 Codeigniter 强制使用 https ://www.

phpstorm - 为什么 PhpStorm 的调试窗口中没有显示变量?

php - 递归删除 .php .htaccess 和 Wordpress

.htaccess - 我如何将不存在的 Joomla URLS 重定向到我们的 404 错误页面?