我的 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/