2013-07-28 44 views
0

我經歷了許多資源在這裏和其他地方在網絡,但似乎無法使它的工作。 我在主目錄中有codeigniter應用程序。 Sym鏈接craeated在/ var/www/html中。 下面的鏈接工作正常。符號鏈接Codeigniter應用程序 - 從URL刪除index.php

http://mydomain.net/dms/index.php/welcome 

但是沒有的index.php,我想下面的鏈接工作

http://mydomain.net/dms/welcome 

代碼點火器2.1.1目錄:

dms 
    application 
    system 
    index.php 
    .htaccess 

的config.php

$config['index_page'] = ""; 
$config['uri_protocol'] = "AUTO"; 

routes.php文件

$route['default_controller'] = "welcome"; 

配置文件httpd.conf

<Directory /> 
    Options FollowSymLinks 
    AllowOverride All 
</Directory> 
Alias /dms/ "/var/www/html/dms/" 
<Directory "/var/www/html/dms"> 
    Options Indexes MultiViews FollowSymLinks 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
</Directory> 

符號鏈接

ls -l /var/www/html 
dms -> /home/user1/dms 

.htaccess文件:

RewriteEngine On 
# enable symbolic links 
Options +FollowSymLinks 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-l 
RewriteRule ^(.+) index.php [L] 

我試圖保持.htaccess文件在CI文件夾文件夾中的/ home /用戶1/DMS,後來在/ var/www/html等 兩個沒有工作。 我收到錯誤(HTTP錯誤日誌)

"File does not exist: /var/www/html/dms/welcome" 

請幫助。

+0

.htaccess文件是由基督教Giupponi下面我在評論中提到矯正工作給予。 AllowOverride在服務器級別的所有 不是必需的,但在特定的目錄級別是必須的。謝謝 – user2627240

回答

0

我用這個的.htaccess和它的作品對我來說,嘗試:

<IfModule mod_rewrite.c> 
     # Make sure directory listing is disabled 
     Options +FollowSymLinks -Indexes 
     # disable the Apache MultiViews directive if it is enabled on the server. It plays havoc with URL rewriting 
     Options -MultiViews 
     RewriteEngine on 

     <IfModule mod_php5.c> 
      RewriteRule ^(.*)$ index.php/$1 [L] 
     </IfModule> 

     <IfModule !mod_php5.c> 
      RewriteRule ^(.*)$ index.php?/$1 [L] 
     </IfModule> 

    </IfModule> 
+0

我在codeigniter應用程序目錄中將我的.htaccess文件更改爲上面給出的內容。現在我得到500內部錯誤。日誌文件顯示 - 由於可能的配置錯誤,請求超出了10個內部重定向的限制。如果需要,使用'LimitInternalRecursion'來增加限制。任何提示? – user2627240

+0

RewriteRule ^([^ /] *)$ index.php/$ 1 [L]和RewriteRule ^([^ /] *)$ index.php?/ $ 1 [L]有效。謝謝 – user2627240