Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在不显示控制器和函数名的情况下设置URL_Php_Codeigniter_Url_Url Rewriting_Url Routing - Fatal编程技术网

Php 如何在不显示控制器和函数名的情况下设置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 这会有帮助

我想显示这个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

这会有帮助的


我们可以在
应用程序/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']中写的名字。
    。所以,在你想使用路线的地方,你可以写下与你使用的相同的名字<李>`