我只是想路由我的网址是像开始使用URL路由与PHP笨
http://localhost/codeigniter_cup_myth/index.php/adminController/mainAccount
,这将是相当不错的,如果它是
http://localhost/codeigniter_cup_myth/Accounts/mainAccount
凡应我在我的Web应用程序中路由URL时开始?
我只是想路由我的网址是像开始使用URL路由与PHP笨
http://localhost/codeigniter_cup_myth/index.php/adminController/mainAccount
,这将是相当不错的,如果它是
http://localhost/codeigniter_cup_myth/Accounts/mainAccount
凡应我在我的Web应用程序中路由URL时开始?
此外,添加类似:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
到你的.htaccess文件将摆脱index.php的部分
路线被定义为这样的:
$route['product/:num'] = "catalog/product_lookup";
其中product
/anynumber
是你的网址:http://www.example.com/product/234。第二部分是控制器/方法。我们在这里讨论的URL将调用目录控制器的product_lookup方法。
$route['accounts/mainaccount'] = "adminController/mainAccount"
会激发你在找什么。有关更多示例,请参阅CodeIgniter User Guide。
我用这个.htaccess
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
它允许访问的任何实际存在的文件,一切都被路由到CI。
ü可以检查宇URL路由组件
woo url路由功能:
很好,它帮助我... – chhameed 2011-10-18 12:04:22