Kohana:“HTTP_Exception_404[404]:在这个服务器上没有找到所请求的URL addon/about。”

时间:2021-08-10 11:10:27

My primary website use Kohana framework. And I want create any directory (addon) with CI framework. I have success access the root of addon directory with addition .htaccess rule in Kohana/primary domain:

我的主要网站使用Kohana框架。我想用CI框架创建任何目录(addon)。我成功访问了addon目录的根目录,并在Kohana/primary域中添加.htaccess规则:

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} ^site\.com [NC]
RewriteRule (.*) http://www.site.com/$1 [L,R=301]

RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]

RewriteRule ^(index\.php|sitemap\.xml|addon) - [PT,L]

RewriteRule .* index.php?/$0 [PT,L,QSA]

I success when type site.com/addon.

我成功的类型是site.com/addon。

I have 3 url again in my addon site such us site.com/addon/about, site.com/addon/link, site.com/addon/contact. When I edit again the .htaccess in primary domain to access the another links of my directory, but its failed.

我在addon网站上又有了3个网址,网址是www.addon/about.site.com/addon/link.site.com/addon/contact。当我重新编辑主域的.htaccess以访问我的目录的另一个链接时,但它失败了。

RewriteRule ^(addon|addon/about|addon/link|addon/contact) - [PT,L]

When I type in URL site.com/addon/about

当我输入URL site.com/addon/about时。

I got

我得到了

HTTP_Exception_404 [ 404 ]: The requested URL addon/about was not found on this server.

SYSPATH/classes/kohana/request/client/internal.php [ 87 ] 

How to access full or all of my directory file (addon) links without get any trouble ? Because I also check my admin on addon/admin also crash, all function in framework CI will crashed. Solving this is appreciate.

如何访问完整或所有我的目录文件(addon)链接,没有任何麻烦?因为我也检查了我的管理上的addon/admin也崩溃了,所有的功能在框架CI都会崩溃。解决这是欣赏。

.htaccess CI:

. htaccess置信区间:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]  

1 个解决方案

#1


1  

You need to not rewrite if you are looking to use the addon directory. Something like

如果希望使用addon目录,则不需要重写。类似的

RewriteEngine On
RewriteBase /
#forbidden for these folders
RewriteRule ^(application|modules|system) - [F,L]
#do not rewrite requests to addon or test directories
RewriteCond %{REQUEST_URI} !^(/test|/addon)
RewriteRule ^(.*)$ index.php/$0 [PT,L]

http://htaccess.madewithlove.be/ can be helpful with .htaccess issues.

http://htaccess.madewithlove。对.htaccess问题有帮助。

#1


1  

You need to not rewrite if you are looking to use the addon directory. Something like

如果希望使用addon目录,则不需要重写。类似的

RewriteEngine On
RewriteBase /
#forbidden for these folders
RewriteRule ^(application|modules|system) - [F,L]
#do not rewrite requests to addon or test directories
RewriteCond %{REQUEST_URI} !^(/test|/addon)
RewriteRule ^(.*)$ index.php/$0 [PT,L]

http://htaccess.madewithlove.be/ can be helpful with .htaccess issues.

http://htaccess.madewithlove。对.htaccess问题有帮助。