开发者

PHP +CodeIgniter , RestFul Url without MVC?

开发者 https://www.devze.com 2023-01-17 11:39 出处:网络
I would use CodeIgniter i开发者_JAVA百科n my new project, but i only use the helper function, so

I would use CodeIgniter i开发者_JAVA百科n my new project, but i only use the helper function, so Can i run my php script as CodeIgniter restful Url function but not in MVC?

or i can done by Apache rewrite mod instead?


Apache rewrites would be more suitable if you don't have a need to use CodeIgniter.

In your .htaccess file you'd use something like:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?page=$1 [PT]

Then you can use http://yoursite.com/whatever and $_GET['page'] will equal whatever.

0

精彩评论

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