Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 404页面重定向到自定义页面_Apache_.htaccess_Redirect_Http Status Code 404 - Fatal编程技术网

Apache 404页面重定向到自定义页面

Apache 404页面重定向到自定义页面,apache,.htaccess,redirect,http-status-code-404,Apache,.htaccess,Redirect,Http Status Code 404,例如,我有以下页面给出404错误 我想上面的网页到以下网址只有当上面的网页返回404错误 如何在.htaccess中执行此操作 感激 问候,, Raja在www.example.com的文档根目录中的htaccess文件中,添加: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?example.com$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILEN

例如,我有以下页面给出404错误

我想上面的网页到以下网址只有当上面的网页返回404错误

如何在.htaccess中执行此操作

感激

问候,,
Raja

www.example.com
的文档根目录中的htaccess文件中,添加:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?example.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?requirements/about-tn/about-us.html http://rd.example.com/requirements/about-tn/about-us.html [L,R]