![](/img/trans.png)
[英]Debian - htacces 404 not found The requested URL was not found on this server
[英]Debian 404 The request url not found on this server
我是Linux环境的新手。 我已经安装了debian os和apache2服务器。 我一直在做一个代码点火器项目。 我的问题是,我能够在代码点火器中呈现索引文件。 但是如果我进入localhost / login或localhost / register之类的内部页面,我会得到这个
The requested url not found on this server
错误。 如何克服这个?
这是我的apache2 / sites-enabled / 000-default
ServerAdmin网站管理员@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
使用以下命令启用apache2模块“ mod_rewrite”
a2enmod rewrite
之后,允许您的目录使用以下命令覆盖此模块的规则
AllowOverride FileInfo
我不使用CodeIgniter,但据我所知,我希望它在.htaccess中使用mod重写,这意味着您的<Directory />
和<Directory /var/www/>
应该是AllowOverride All
。 您可能还需要在命令行上进行a2enmod rewrite
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.