我有一个自定义404错误页面和一个mod_rewrite规则。如果我访问一个不存在的页面,我将得到404错误页面。我的问题是,如果我从我的php页面发出404头,它不会打开我的404页,相反,我得到以下内容:
Not Found
The requested URL /index.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying
to use an ErrorDocument to handle the request.
这是我的.htacces
我正试图通过htaccess找到做以下工作的方法。
extensionRemove尾随斜杠(/) Remove (/)重定向器(.php)页面到非php页面将根索引的所有跟踪重定向到根域
下面是目录结构的一个示例。
"http://example.com" (canonical - this is what I want)
"http://example.com/index" (redirect or 404)
"http://example.com/index/" (redirect or 404)
"http://example.co
我正在尝试添加一个404错误页面到我的网站,然而,当我试图访问它时,我得到了这个错误。 Not Found
The requested URL /asd.html was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. 我的.htaccess页面仅包含以下行: ErrorDocument 404 /404-page.php; 下面的404-page.php文件和.
我正在尝试实现一个自定义404错误页面,但这就是我得到的
**The requested URL /about/hdhdhdh.php was not found on this server.
Additionally , a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request**
在我的.htaccess里面我有这个
ErrorDocument 404 /404.php
.htaccess和404.php都位于同一个目录中。拜托,有什么问题吗
我编辑了htaccess文件,以便将mysite.com/page重写为mysite.com/page.php,并在用户请求mysite.com/page.php而不是mysite.com/page时显示404错误页。
我还添加了自己的自定义404错误页面。
但是,当我请求mysite.com/page.php时,显示的错误页是Apache 404错误页(而不是我的自定义错误页面),还有其他错误信息:
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocum
当用户访问具有.php扩展名的php文件时,我想显示错误页面。但这并没有显示我设置的自定义错误页面。相反,它将显示默认的Apache错误页面。
# Run Php without filename extension
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
# Return 404 if original request is .php
RewriteCond %{THE_REQUEST} "