Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/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
Php 向Codeigniter页面添加.HTML扩展名_Php_Codeigniter - Fatal编程技术网

Php 向Codeigniter页面添加.HTML扩展名

Php 向Codeigniter页面添加.HTML扩展名,php,codeigniter,Php,Codeigniter,是否可以在Codeigniter中为每个帖子页面添加.html扩展名?我的当前页面URL看起来像 News是类别名称,first_post是帖子名称。我希望第一篇文章以.html结尾,比如 如果我当前的URL中没有显示扩展名,我如何实现这一点 谢谢 在config.php上设置url后缀 $config['url_suffix'] = '.html'; 在config.php上设置url后缀 $config['url_suffix'] = '.html'; 你需要在服务器(Apache,Ng

是否可以在Codeigniter中为每个帖子页面添加.html扩展名?我的当前页面URL看起来像

News是类别名称,first_post是帖子名称。我希望第一篇文章以.html结尾,比如

如果我当前的URL中没有显示扩展名,我如何实现这一点


谢谢

在config.php上设置url后缀

$config['url_suffix'] = '.html';

在config.php上设置url后缀

$config['url_suffix'] = '.html';

你需要在服务器(Apache,Nginx)中重写规则你需要在服务器(Apache,Nginx)中重写规则很好,这正是我要找的+1我如何才能将特定页面url(如
contact.php
更改为
contact.xml
而不是所有页面?很好,正是我所寻找的+1如何将特定页面url(如
contact.php
更改为
contact.xml
)而不是所有页面?