我现在的网址是http://localhost/ci/也被下的config.phpCodeIgniter的URL路由
设置,但我怎么打开视图其他页面,而不specifing的index.php
的http:/本地主机/ CI /页/查看/登录,但不喜欢这样的http:/localhost/ci/index.php/Pages/view/login
我现在的网址是http://localhost/ci/也被下的config.phpCodeIgniter的URL路由
设置,但我怎么打开视图其他页面,而不specifing的index.php
的http:/本地主机/ CI /页/查看/登录,但不喜欢这样的http:/localhost/ci/index.php/Pages/view/login
你应该看看这个
http://www.freewebmasterhelp.com/tutorials/htaccess/
可以用.htaccess
文件做了很多尝试 把这个在您的.htaccess
文件
RewriteEngine on
RewriteCond $1 ^(Pages|view|login|P[0-9]{2,8}) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
使用application/config/routes.php文件。
添加URL路由定义非常简单。
请参阅此链接了解更多信息:http://codeigniter.com/user_guide/general/routing.html
您从视图文件夹直接不打开的文件。它不是那样的工作 – safarov 2012-03-29 10:46:06
CodeIgniter有一些关于设置“RewriteRules”的文档。 – mario 2012-03-29 10:46:25
[CodeIgniter设置干净网址]的可能重复(http://stackoverflow.com/questions/8161171/setup-clean-urls-like-codeigniter) – mario 2012-03-29 10:47:46