2017-03-19 35 views
0

我試圖從Azure服務器託管的codeigniter項目中的我的url中刪除index.php。如果我手動從url中刪除了index.php它顯示「您正在尋找的資源已被刪除,名稱已更改,或暫時不可用。「以下是我的.htaccess文件如何從codeigniter項目中的url中刪除index.php

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* /index.php/$0 [PT,L] 

我的配置文件

$config['base_url'] = 'http://myapp.azurewebsites.net/'; 
$config['index_page'] = ''; 
$config['uri_protocol'] = 'REQUEST_URI'; 
+2

可能重複[刪除CodeWord URL中的index.php](http://stackoverflow.com/questions/22115098/remove-index-php-in-codeigniter-url) –

+0

我使用.htaccess按照上述鏈接建議但仍顯示「您正在查找的資源已被刪除,名稱已更改或暫時無法使用。」 –

+0

在標題中添加「Azure服務器」,人們不會很快投票 – qwertzman

回答

2

基本上,在Azure的Web應用程序,你可以通過在Azure門戶添加默認文檔實現這一目標。

  1. Azure Portal中,打開Web應用程序的刀片。
  2. 點擊應用程序設置
  3. index.php添加到默認文檔列表。

enter image description here

BTW,天青使用IIS(而不是Apache)託管的應用程序,所以.htaceess文件不Azure的Web應用程序的工作。