[英]How to route request to codeigniter project outside document root
我使用codeigniter項目具有以下共享托管文件結構:
myTLD.com/sites/mysite
mysite contains: application, system , index.php ... ( standard CI2 setup )
myTLD.com/public_html - contains : index.php
我已將myTLD.com/public_html/index.php鏈接到myTLD.com/sites/mysite/index.php
不幸的是我得到:
Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php
我以這種方式進行設置,以避免出於安全目的將實際站點放置在文檔根目錄中。 我不想更改mysite / index.php,因為我想將整個項目保留在mysite目錄中,在該目錄中可以輕松進行修改等。
該應用程序和mysite /文件夾設置為755,所以我認為這不是權限問題。
我的myTLD.com/public_html/.htaccess文件夾將所有請求定向到index.php:
RewriteEngine On
RewriteRule ^(.*)$ index.php
有人可以建議我將請求發送到codeigniter索引文件而不引起此錯誤的方法嗎?
謝謝
您可以嘗試以下方式
1)刪除符號鏈接
2)在myTLD.com/public_html/.htaccess
htaccess中使用它
RewriteEngine on
RewriteRule ^(.*)$ myTLD.com/sites/mysite/index.php?/$1 [L]
如果知道,請使用絕對系統路徑。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.