Debian - 未找到 htacces 404 在此服务器上未找到请求的 URL

Debian - htacces 404 not found The requested URL was not found on this server

我在 wamp 上开发了一个完美运行的网站(包括 .htaccess)。

所以我在 debian 服务器上部署了站点,但出现以下错误:

404 Not Found - The requested URL was not found on this server.

这是我的文件的内容:

#Options FollowSymLinks
RewriteEngine on
RewriteRule ^([a-zA-Z\_\-]+)/([a-z0-9_\-]+)/?$ index.php?page=&param= [QSA]
RewriteRule ^([a-zA-Z\_\-]+)/?$ index.php?page= [QSA]

所有文件都属于用户www-datarewrite module 启用。

谢谢。

在您的 apache 配置中。

在虚拟主机或默认配置上,您必须 AllowOverride 到您的域或文件夹。

<Directory "/">
    AllowOverride ALL
</Directory>

如果你不能覆盖你的 .htaccess 将无法工作,如果你不能重写你正在访问的 url 不存在并且你将收到 404 错误。