Php 如何在不显示控制器和函数名的情况下设置URL
我想显示这个URL 不显示控制器名称和函数名称。。。Php 如何在不显示控制器和函数名的情况下设置URL,php,codeigniter,url,url-rewriting,url-routing,Php,Codeigniter,Url,Url Rewriting,Url Routing,我想显示这个URL 不显示控制器名称和函数名称。。。 因此,如何做到这一点,请告诉我如何解决这个问题…尝试编辑到route.php文件的路由,您可以在application/config/route.php中找到它 添加行后,如$route['mycustomurl']='Services/index';你的url就像http://localhost/index.php/mycustomurl。 有关codeigniter路线的更多详细信息,请阅读文档 如果要删除index.php 这会有帮助
因此,如何做到这一点,请告诉我如何解决这个问题…尝试编辑到
route.php
文件的路由,您可以在application/config/route.php
中找到它添加行后,如
$route['mycustomurl']='Services/index'
;你的url就像http://localhost/index.php/mycustomurl
。
有关codeigniter路线的更多详细信息,请阅读文档如果要删除
index.php
这会有帮助的
尝试编辑到
route.php
文件的路由,您可以在application/config/route.php
中找到它添加行后,如
$route['mycustomurl']='Services/index'
;你的url就像http://localhost/index.php/mycustomurl
。
有关codeigniter路线的更多详细信息,请阅读文档如果要删除
index.php
这会有帮助的
我们可以在
应用程序/config/routes.php
中使用路由
看看这个例子
$route['route\u name\u you want\u to\u Show']='Services/index'代码>
如果您想删除index.php,请将下面的代码添加到.htaccess中
htaccess
RewriteEngine On
RewriteBase /ci/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
ErrorDocument 404 /index.php
我们可以在应用程序/config/routes.php
中使用路由
看看这个例子
$route['route\u name\u you want\u to\u Show']='Services/index'代码>
如果您想删除index.php,请将下面的代码添加到.htaccess中
htaccess
RewriteEngine On
RewriteBase /ci/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
ErrorDocument 404 /index.php
可能重复的href链接中如何调用路由的可能重复??谢谢,我已经在第一行中提到,您必须在哪里定义路线
不,我的意思是如何在href链接中调用路线好的……在那个地方,你可以写你在$route['route\u name\u you\u want\u show']中写的名字。
。所以,在你想使用路线的地方,你可以写下与你使用的相同的名字`我如何在href链接中调用路由??谢谢,我已经在第一行中提到,您必须在哪里定义路线
不,我的意思是如何在href链接中调用路线 好的……在那个地方,你可以写你在$route['route\u name\u you\u want\u show']中写的名字。
。所以,在你想使用路线的地方,你可以写下与你使用的相同的名字<李>`