开发者

How to access a .php file with Kohana (ignore routing)

let's say we have simple file

<?php
echo "hello world"

I'd like to place the file in /modules/myModul/(somewhere).

Where do I开发者_Python百科 have to save the file and how do i call it via the browser url?


As far as I know, Kohana's default .htaccess already includes the check whether the URL corresponds to a real file

RewriteCond %{REQUEST_FILENAME} !-f

So if you save this php file somewhere and access it by the URL you would expect to find it at, the request will not be sent to Kohana at all.

If you placed the file in /modules/myModul/example.php, then the URL would be http://www.example.com/modules/myModul/example.php


By default every file in application|modules|system will be hidden. You should use webroot directory (were the index.php and .htaccess placed) or another directory (for example, create public folder for your non-framework scripts). So, it will be http://example.com/script.php or http://example.com/public/script.php.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜