![](/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.