簡體   English   中英

Codeigniter current_url()跳過index.php

[英]Codeigniter current_url() skip index.php

我正在使用下面的代碼來獲取current_url()但發現該www.xxxx.com/index.php/home/xxxx。 index.php在調用current_url()被跳過。 它存儲了www.xxxx.com/home/xxxx。 這是正常行為嗎? 如果我需要包含index.php ,怎么辦?

嘗試這個,

打開config.php並執行以下替換

$config['index_page'] = ""

$config['index_page'] = "index.php"

可以做2個提示

  1. config.php中

     $config['index_page'] = "index.php" 
  2. config.php中

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM