當我有我的開發環境中的網站 - 這是網址:testurl.com如何設置正確的codeigniter基礎url?
現在生產服務器上我笨的應用程序的地址必須someurl.com/mysite/
我把它那裏,每次我試圖運行一些功能,例如/home/test - 它讓我進入someurl.com/home/test - 這是錯誤的。
它必須是someurl.com/mysite/home/test - 如何解決它?我沒有設定
$config['base_url'] = someurl.com/mysite/
+1爲您的絕對參考答案...但看着這個,我有疑問...是不是一個壞主意CodeIgniter文件和'somesite'文件在相同的位置(即www)?我的意思是這不會使外部機器人使用CodeIgniter文件加速嗎?只是好奇... – itsols 2013-01-16 10:05:13
潛在的,是的,有需要考慮兩件事情:1)所有的CI項目文件應該有'如果(定義(「基本路徑」!))退出()「允許無直接腳本訪問」;'作爲第一行。這可以防止腳本本身運行,因爲'BASEPATH'常量沒有另外定義(無論是CI的前端控制器還是其他腳本)。 2)只要您在CI的前端控制器(index.php)中指定了它們的路徑,就可以安全地將'system'和'application'文件夾移動到webroot(www,就你的案例而言)之外。基本上你的webroot只會包含index.php和assets。希望有所幫助。 – Brendan 2013-01-16 17:20:52
什麼是overiding此的baseUrl – 2017-06-21 12:54:38