简体   繁体   中英

Debian 404 The request url not found on this server

I'm new to linux environment. I have installed debian os and apache2 server. 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

The requested url not found on this server 

error. How to over come this?

This is my 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

Enable the apache2 modmule "mod_rewrite" with

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 . You may also need to a2enmod rewrite at the command line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM