2013-10-13 50 views
0

我已经阅读了很多与同样的问题的主题,但我找不到解决方案...请帮助我。我有一个灯到Ubuntu服务器。我的文档根目录是/ home/utente /进入这个目录我有一个codeigniter web应用程序的另一个目录(turni)。网络应用程序可以正常工作,将“index.php”放入网址中,但我想消除它。我有这样的配置:htaccess vhost codeigniter index.php

config.php文件到笨:

$config['index_page'] = ''; 

的.htaccess:

RewriteEngine On 
RewriteBase/
RewriteCond %{REQUEST_URI} ^system.* 
RewriteRule ^(.*)$ /index.php?/$1 [L] 
RewriteCond %{REQUEST_URI} ^application.* 
RewriteRule ^(.*)$ /index.php?/$1 [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L] 

的/ etc/apache2的/网站可用/默认:

<VirtualHost *:80> 
    ServerAdmin [email protected] 

    DocumentRoot /home/utente 
    <Directory /> 
      Options FollowSymLinks 
      AllowOverride None 
    </Directory> 
    <Directory /home/utente/> 
      Options Indexes FollowSymLinks MultiViews 
      AllowOverride None 
      Order allow,deny 
      allow from all 
    </Directory> 

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
    <Directory "/usr/lib/cgi-bin"> 
      AllowOverride None 
      Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
      Order allow,deny 
      Allow from all 
    </Directory> 

    ErrorLog ${APACHE_LOG_DIR}/error.log 

    # Possible values include: debug, info, notice, warn, error, crit, 
    # alert, emerg. 
    LogLevel warn 

    CustomLog ${APACHE_LOG_DIR}/access.log combined 

Alias /doc/ "/usr/share/doc/" 
<Directory "/usr/share/doc/"> 
    Options Indexes MultiViews FollowSymLinks 
    AllowOverride None 
    Order deny,allow 
    Deny from all 
    Allow from 127.0.0.0/255.0.0.0 ::1/128 
</Directory> 

当我打开链接的Web应用程序与没有呃“index.php”到URL中,服务器或我这个错误:在此服务器上找不到请求的URL/turni/auth/login。

为什么?如果我把index.php像/turni/index.php/auth/login所有工作正常.... 感谢您的帮助和对不起,我的英语:D

回答

0

将.htaccess添加到您的服务器根目录并更改重写基地

RewriteBase /turni 

假设你笨出现在/ var/WWW/turni

+0

感谢响应!我试过但它没有改变:(我的codeigniter存在/ home/utente/turni /任何其他解决方案? – Mattia