![](/img/trans.png)
[英]how to skip index.php and method name in url of codeigniter 1.7.2?
[英]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個提示
在config.php中
$config['index_page'] = "index.php"
在config.php中
$config['base_url'] = 'www.example.com/index.php/';
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.