简体   繁体   English

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

[英]Debian 404 The request url not found on this server

I'm new to linux environment. 我是Linux环境的新手。 I have installed debian os and apache2 server. 我已经安装了debian os和apache2服务器。 I have been doing a code igniter project. 我一直在做一个代码点火器项目。 My problem is, I'm able to render index file in code igniter. 我的问题是,我能够在代码点火器中呈现索引文件。 But If I go into inner pages like localhost/login or localhost/register I get this 但是如果我进入localhost / login或localhost / register之类的内部页面,我会得到这个

The requested url not found on this server 

error. 错误。 How to over come this? 如何克服这个?

This is my apache2/sites-enabled/000-default 这是我的apache2 / sites-enabled / 000-default

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

Enable the apache2 modmule "mod_rewrite" with 使用以下命令启用apache2模块“ mod_rewrite”

a2enmod rewrite

After that, allow for you directory to overwrite rules for this module with 之后,允许您的目录使用以下命令覆盖此模块的规则

AllowOverride FileInfo

I don't use CodeIgniter, but from what I know of it, I expect it uses mod rewrite in .htaccess, which means your <Directory /> and <Directory /var/www/> should be AllowOverride All . 我不使用CodeIgniter,但据我所知,我希望它在.htaccess中使用mod重写,这意味着您的<Directory /><Directory /var/www/>应该是AllowOverride All You may also need to a2enmod rewrite at the command line. 您可能还需要在命令行上进行a2enmod rewrite

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Debian - htacces 404 not found 在此服务器上找不到请求的 URL - Debian - htacces 404 not found The requested URL was not found on this server 找不到404:在此服务器上找不到请求的URL - 404 Not Found: The requested URL was not found on this server $_SERVER[&quot;REQUEST_URI&quot;] 路由仅适用于基本 url 并返回 404 Not Found on pages - Routing by $_SERVER["REQUEST_URI"] only works for base url and returns 404 Not Found on pages Kohana 404在此服务器上找不到请求的URL /评论 - Kohana 404 The requested URL /reviews was not found on this server 404 未找到,请求的 URL &lt;<url name> &gt; 在 wordpress 中未在此服务器上找到 - 404 not found , the requested URL <<url name>> not found on this server in wordpress 在服务器codeigniter上找不到请求URL - Request URL was not found on server codeigniter Apache2 / ZendServer / PHP-控制器URL请求给出404找不到 - Apache2 / ZendServer / PHP - Controller URL request gives 404 not found Guzzle 向自己的服务器发送请求导致“404 Not Found” - Guzzle post request to own server resulted in a `404 Not Found` 404错误-在此服务器上找不到请求的URL / &lt;。 为什么? - 404 error - The requested URL/< was not found on this server. why? nginx 服务器有时会返回 404 Not Found for valid a URL - nginx server sometime returns 404 Not Found for valid a URL
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM