Codeigniter current_url()跳过index.php

Codeigniter current_url()跳过index.php,php,codeigniter,Php,Codeigniter,我使用下面的代码来获取当前的url(),但发现www.xxxx.com/index.php/home/xxxx。调用current\u url()时跳过index.php。It商店www.xxxx.com/home/xxxx。 这真的是正常的行为吗? 如果我需要包括index.php,如何做???试试这个 打开config.php并执行以下操作: $config['index\u page']=“” 到 $config['index\u page']=“index.php”试试这个 打开conf

我使用下面的代码来获取当前的url(),但发现www.xxxx.com/index.php/home/xxxx。调用
current\u url()
时跳过index.php。It商店www.xxxx.com/home/xxxx。 这真的是正常的行为吗? 如果我需要包括
index.php
,如何做???

试试这个

打开config.php并执行以下操作:

$config['index\u page']=“”

$config['index\u page']=“index.php”

试试这个

打开config.php并执行以下操作:

$config['index\u page']=“”

$config['index\u page']=“index.php”

可以做两个提示

  • config.php中

    $config['index_page'] = "index.php"
    
    $config['base_url'] = 'www.example.com/index.php/';
    
  • config.php中

    $config['index_page'] = "index.php"
    
    $config['base_url'] = 'www.example.com/index.php/';
    
  • 我可以做两个小贴士

  • config.php中

    $config['index_page'] = "index.php"
    
    $config['base_url'] = 'www.example.com/index.php/';
    
  • config.php中

    $config['index_page'] = "index.php"
    
    $config['base_url'] = 'www.example.com/index.php/';