Tag: .htaccess

如何在Ubuntu 14.04中创建自定义ErrorDocument页面?

我是Ubuntu的新手,我使用的是Ubuntu Server 14.04。 现在我想使用我自己设计的HTML网页作为我的服务器状态错误,如404等。我尝试了自己的方式,但没有得到我的设计页面,当我打开192.168.1.99/404时,我得到服务器默认错误页面文件不在我的var/www/ ,如下所示。 我的var/www/文件夹中有index.html , 404.html , .htaccess文件。 我的.htaccess文件仅包含ErrorDocument 404 /404.html行。 我没有更改任何默认设置。 我只是安装Ubuntu Server 14.04并通过终端使用它。 你能告诉我现在该做什么吗?

在apache2中启用.htaccess

这可能与Ubuntu本身没有直接关系,但目录树在这里有所不同,我有点困惑。 我有一个网站,我正在尝试运行它加载正常,但它严重依赖URL重写我没有得到因为.htaccess指令可能没有在我的安装中启用。 我已经按照Ubuntu.com上的文章在我的apache2上启用了.htaccess文件,但我无法关注它,因为它告诉我要更改的文件不存在于它告诉我去的文件夹中。 这是最接近default文件名 – 000-default.conf : # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request’s Host: header to # […]