为什么CodeIgniter 4的anchor()使用site_url()格式(带有indexPage)而不是base_url()(没有indexPage)?

问题描述 投票:0回答:1

anchor()生成链接,并附加indexPage,例如http://example.com/index.php/news/local/123。没有indexPage会更漂亮(在SEO方面)吗?例如http://example.com/news/local/123base_url()一样吗?这样做的不利之处是什么?

是否有配置选项?

php codeigniter php-7 codeigniter-4
1个回答
1
投票

在app \ Config \ App.php中设置

public $indexPage = '';

您的问题已解决。

© www.soinside.com 2019 - 2024. All rights reserved.