Debian 404在此服务器上找不到请求URL

时间:2014-08-05 04:54:40

标签: php linux apache debian http-status-code-404

我是linux环境的新手。我已经安装了debian os和apache2服务器。我一直在做一个代码点火器项目。我的问题是,我能够在代码点火器中渲染索引文件。但是,如果我进入内部页面,如localhost / login或localhost / register,我会得到这个

The requested url not found on this server 

错误。怎么过来这个?

这是我的apache2 / sites-enabled / 000-default

    ServerAdmin webmaster @ localhost

DocumentRoot /var/www
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /var/www/>
    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

2 个答案:

答案 0 :(得分:2)

使用

启用apache模块“mod_rewrite”
a2enmod rewrite

之后,允许您的目录使用

覆盖此模块的规则
AllowOverride FileInfo

答案 1 :(得分:1)

我没有使用CodeIgniter,但据我所知,我希望它在.htaccess中使用mod重写,这意味着你的<Directory /><Directory /var/www/>应该是{{1} }。您可能还需要在命令行AllowOverride All

相关问题