htaccess正确吗?
虽然我可以很好地运行 test.cgi 但我的 perl 全部不起作用,这个 htaccess 是否正确:
AddHandler cgi-script .cgi
Options +ExecCGI
IndexIgnore *
DirectoryIndex myapp.cgi
RewriteEngine on
RewriteRule ^$ myapp.cgi [L]
RewriteRule ^/$ myapp.cgi [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ myapp.cgi/$1
Although I can run test.cgi fine but my perl all doesn't work, is this htaccess correct:
AddHandler cgi-script .cgi
Options +ExecCGI
IndexIgnore *
DirectoryIndex myapp.cgi
RewriteEngine on
RewriteRule ^$ myapp.cgi [L]
RewriteRule ^/$ myapp.cgi [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ myapp.cgi/$1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明,mediatemple 的 PERL 版本是 5.8.4,而我的应用程序仅与 5.8.8+ 兼容。
Turns out that mediatemple's PERL version is 5.8.4 and my app is only compatible with 5.8.8+.
Apache 返回什么类型的错误?如果它看起来像权限,请尝试
在 RewriteEngine 行之前添加:,看看是否有帮助。
另外,除非您确定您的重写规则是正确的,否则我会将它们注释掉,直到您看到您的脚本按预期运行。如果脚本在没有它们的情况下无法工作,那么出于测试目的,将其替换为非常简单的东西,以确保 Apache 正常工作。
What kind of error is Apache returning? If it looks like permissions, try adding:
before the RewriteEngine line and see if that helps.
Also, unless you're sure that your rewrite rules are correct I'd comment them out until you see that your script runs as it should. If the script won't work without them then replace it for testing purposes with something really simple just to make sure that Apache's working correctly.