我的網站托管在上述域的托管網站不是可簽名的https://www.webdomain.com/在服務器上的 位置 上,托管了一個代碼刻度轉換器應用程序。my_username/public_html/www/myproject意思是,訪問一個及其在應用程序中。controllerfunctionmyproject我使用以下網址https://webdomain.com/myproject/controller/function您可能已經注意到,是代碼字符應用程序的根文件夾myproject我一直試圖從URL中刪除,但沒有運氣。myproject我已經經歷了幾個關于堆棧溢出的問題,但正如我所想的那樣,所有這些問題都涉及項目目錄,不一定是應用程序根目錄。在我的情況下,我想從URL中刪除根目錄的名稱。myproject這是我的:.htaccessRewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.*)$ index.php/$1
3 回答

繁星點點滴滴
TA貢獻1803條經驗 獲得超3個贊
您是否嘗試過在路線.php文件中設置路線?
$route['controller/function'] = 'myproject/controller/function';

一只斗牛犬
TA貢獻1784條經驗 獲得超2個贊
嘗試使用 .我主要在機器上使用這個。此文件應位于 of 文件夾中。以下是有關 https://httpd.apache.org/docs/current/howto/htaccess.html 的更多信息的文檔.htaccess
localhost
.htaccess
root
myproject
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /myproject/ RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L,QSA] </IfModule>
- 3 回答
- 0 關注
- 100 瀏覽
添加回答
舉報
0/150
提交
取消