htaccess 未指定输入文件

发布于 2024-12-26 21:07:17 字数 1141 浏览 0 评论 0原文

我有几个应用程序在 Kohana 2.3.x 上运行。今天,我的托管提供商升级了机器,我的网站停止运行。尝试打开网站时,我收到未指定输入文件。我发现 .htaccess 文件有问题,尤其是我驱逐 index.php 部分的规则......我需要紧急 fi !谢谢。我的 .htaccess:

# Turn on URL rewriting
RewriteEngine On

# Put your installation directory here:
# If your URL is www.example.com/kohana/, use /kohana/
# If your URL is www.example.com/, use /
RewriteBase /

# Protect application and system files from being viewed
RewriteCond $1 ^(system)

# Rewrite to index.php/access_denied/URL
RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]

# Allow these directories and files to be displayed directly:
# - index.php (DO NOT FORGET THIS!)
# - robots.txt
# - favicon.ico
# - Any file inside of the images/, js/, or css/ directories
RewriteCond $1 ^(index\.php|robots\.txt|sitemap\.xml|favicon\.ico|static/images|static/js|static/css|static/tutorials|upload)

# No rewriting
RewriteRule ^(.*)$ - [PT,L]

# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]
#AddHandler application/x-httpd-php5 .php

如果我评论这部分 RewriteRule ^(.*)$ index.php/$1 [PT,L] 然后网站将打开。怎么了?

I have several applications running on Kohana 2.3.x. Today my hosting provider u pgraded the machines and my sites stopped running. I get the No input file specified when trying to open website. I figures out there is something wrong with .htaccess file especially the rule where I oust index.php part... I need urget fi for this! Thank you. My .htaccess:

# Turn on URL rewriting
RewriteEngine On

# Put your installation directory here:
# If your URL is www.example.com/kohana/, use /kohana/
# If your URL is www.example.com/, use /
RewriteBase /

# Protect application and system files from being viewed
RewriteCond $1 ^(system)

# Rewrite to index.php/access_denied/URL
RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]

# Allow these directories and files to be displayed directly:
# - index.php (DO NOT FORGET THIS!)
# - robots.txt
# - favicon.ico
# - Any file inside of the images/, js/, or css/ directories
RewriteCond $1 ^(index\.php|robots\.txt|sitemap\.xml|favicon\.ico|static/images|static/js|static/css|static/tutorials|upload)

# No rewriting
RewriteRule ^(.*)$ - [PT,L]

# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]
#AddHandler application/x-httpd-php5 .php

If I comment this part RewriteRule ^(.*)$ index.php/$1 [PT,L] then site opens. What is wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

茶色山野 2025-01-02 21:07:17

可能您使用的主机以 CGI 模式安装了 PHP。

您可以尝试这个:

RewriteRule ^(.+)$ index.php?$0 [PT,L,QSA]

或者这个:

RewriteRule ^(.+)$ index.php?kohana_uri=$1 [L]

问候

Probably you are using a host with PHP installed in CGI mode.

You can try this:

RewriteRule ^(.+)$ index.php?$0 [PT,L,QSA]

or this:

RewriteRule ^(.+)$ index.php?kohana_uri=$1 [L]

Regards

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文