Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.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
我想用我的CodeIgniter应用程序的URI路由重写Url_Codeigniter_Url Routing - Fatal编程技术网

我想用我的CodeIgniter应用程序的URI路由重写Url

我想用我的CodeIgniter应用程序的URI路由重写Url,codeigniter,url-routing,Codeigniter,Url Routing,我正在使用codeigniter,我有如下URL()。我的应用程序具有相同的多语言url。像 我想用这样的URI路由重写这个url 我应该如何设置URI路由?使用Apache的mod_rewrite: 将其放入.htaccess文件中: RewriteEngine on RewriteRule ^(en|fr|es|de)/home/(.*)$ $1/$2 [L] 在routes.php中 $route['^(en|fr|es|de)/home/(.*)$'] = "$

我正在使用codeigniter,我有如下URL()。我的应用程序具有相同的多语言url。像

我想用这样的URI路由重写这个url


我应该如何设置URI路由?

使用Apache的mod_rewrite:

将其放入.htaccess文件中:

RewriteEngine on
RewriteRule ^(en|fr|es|de)/home/(.*)$ $1/$2 [L]
在routes.php中

$route['^(en|fr|es|de)/home/(.*)$'] = "$1/$2";
如果不起作用,请尝试:

$route['(en|fr|es|de)/home/(.*)'] = "$1/$2";

我认为你需要与ulvund发布的相反的内容:

$route['(en|fr|es|de)/submit'] = "home/submit/$1";

。。。Home是控制器,submit是方法。

您提出了10个问题,平均得到了3个答案,对您所述的问题有许多深入的解决方案。也许现在是回去接受一些你觉得有用的答案的好时机:-)