htaccess vhost codeigniter index.php

时间:2013-10-13 19:04:08

标签: apache .htaccess codeigniter ubuntu

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

config.php到codeigniter:

$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 webmaster@localhost

    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>

当我打开网页应用程序的链接而没有“index.php”进入网址时,服务器出现此错误:在此服务器上找不到请求的URL / turni / auth / login。

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

1 个答案:

答案 0 :(得分:0)

将.htaccess添加到服务器根目录并将重写基础更改为

RewriteBase /turni

假设您的codeigniter存在于/ var / www / turni