基本上我想刪除我的url中的index.php。使用.htaccess刪除index.php無法在codeigniter hostgator上工作
我認爲我的.htaccess在Hostgator上不工作,我已經在這些.htaccess,codeigniter和hostgator上搜索了我的問題。
這是HostGator的我的文件夾結構
/cgi-bin目錄
/httpdocs資料
| --- /應用
| --- /系統
| ---。。htaccess
| --- index.php文件
我.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
我config.php
$config['base_url'] = 'www.example.com'; // this is only an example because our website is confidential
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
編輯:對不起,我是白癡。我發佈了這個問題並且嘗試了下面的答案後聯繫了Hostgator。他們說我 運行在
Windows server
不是Apache server
所以我的.htaccess
將 不起作用,所以我需要將它轉換爲web.config
。對不起,這些 浪費時間來回答這個問題。謝謝編輯:我標誌着@Deep巴力的回答是正確的作爲@大衛說,一切正常
你改變了config.php嗎? –
看到我的代碼... !!! –
@DeepParekh是先生我已經改變了config.php –