从codeigniter URL

时间:2019-02-25 07:43:54

标签: codeigniter url mod-rewrite url-rewriting url-routing

enter image description here我在名为frontend / page的文件夹中有页面,并且网址显示为www.domain.com/frontend/page/home

如何将其更改为www.domain.com/home 入口首页也是动态的,可能是关于我们或与我们联系 我的.htaccess文件是

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddType application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|uploads|documentation|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

1 个答案:

答案 0 :(得分:0)

如果要将任何页面重定向到frontend/page子目录中的相应控制器,则可以修改以下路由:

$route['(:any)'] = "frontend/page/$1";