errordocument

cPanel Custom 401 Error Page “Not Displaying”

余生颓废 提交于 2021-01-28 20:24:26
问题 My problem: For some reason my custom 401 error page is not displaying on login and is just displaying the generic 401 error page: Unauthorized This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required. Additionally, a 401 Unauthorized error was encountered while trying to use an ErrorDocument to handle the request. Now in

Apache “File not found.” instead of 404. error document

倖福魔咒の 提交于 2020-01-14 14:33:08
问题 I want to set a custom 404 error document, but I have a problem with it! First, I have two RewriteRules in my .htaccess: RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/?$ /$2/$3.php?lang=$1 [L] RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/([^/.]+)/?$ /$2/$3/$4.php?lang=$1 [L] So my URL looks like: /de-de/page/other/stuff and opend /page/other/stuff.php?lang=de-de Now it's time to set my own error document: ErrorDocument 404 /404.php If there is a mistake in "/de-de/page/other/" for example " /de-de/wrong

Use 404 ErrorDocument that is in a sub directory

拈花ヽ惹草 提交于 2019-12-23 15:02:02
问题 I have a htaccess file in a sub folder like so: /subfolder/.htaccess In the htaccess file the following code to set a 404 ErrorDocument ErrorDocument 404 /404.php The issue is the 404 page in the root directory is loaded rather than the one in the /subfolder/ folder. I can't simply change the htaccess file to use /subfolder/404.php because the system is going to be installed in lots of different places. Is there a way to reference the files in the directory that the htaccess is in? 回答1: I

right order of rewrite rules in an htaccess file

时间秒杀一切 提交于 2019-12-23 03:04:49
问题 I need to have : http://www.example.com/v1/my-project/ redirected to http://example.com/my-project/ so : (1) remove the www from the http_host RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^(.*)$ http://example.com/$1 [R=301,L] (2) remove the 'v1/' part of the request_uri RewriteCond %{REQUEST_URI} ^/v1/(.*)$ [NC] RewriteRule . %1 [R=301,L] (3) I also want to redirect all 404 to the homepage. ErrorDocument 404 / (4) Finally, all my documents actually reside in a "v2/" folder

htaccess error 404 handling not working + dynamic 404 error page?

拜拜、爱过 提交于 2019-12-13 06:49:35
问题 First of all, my ErrorDocument 404 /v1 is never redirecting, but if I look in the Chrome Inspector, I really have a 404 error. At first I thought it was because I really needed to specify a file ex: error.html, but that didn't work either. /v1 is just a wordpress subdomain, and I want to redirect all of my errors there. /v1 falls on my homepage of my subdomain. Also I would like to make the error page dynamic, but I can't figure how to do that. Something like that: RewriteCond %{REQUEST

Redirect instead of 404 Error page - Status Code not working (Nginx)

放肆的年华 提交于 2019-12-12 20:25:42
问题 I'm currently moving to an nginx server. I tried putting this in my 404 ErrorDocument named 404.php : <?php header("Location: http://www.google.com/"); ?> If I now try to access http://mydomain.com/404.php , this works as expected: It redirects me to Google. But once I try to access http://mydomain.com/iDoNotExist , the 404 ErrorDocument is shown without redirecting me to Google. This behavior seems weird to me. Is there any way I can fix this? Edit: Here's what curling the page gives me:

Custom 404 page - PHP

爷,独闯天下 提交于 2019-12-12 08:23:06
问题 I have a custom 404 page which works fine except for the message I want to display on this page. I would like it to say the url of the page which can't be found but instead it displays the url of the 404 page. Here's what I have... You were looking for <?php echo $_SERVER['REQUEST_URI'] ?>. The htaccess file contains the line: ErrorDocument 404 /404/ 回答1: You need to use $_SERVER['HTTP_REFERER'] instead - that will be the address they requested first. This only works in the exact case

Make apache mod_proxy ProxyErrorOverride include original page contents with mod_include

烂漫一生 提交于 2019-12-12 01:42:43
问题 I'm using apache mod_proxy to forward certain requests to an IIS server and also use ProxyErrorOverride to provide a corporate style on the error pages. However I would like to include the original servers error message in custom error pages to provide some additional information when debugging 500-errors. Right now the entire error page is replaced. According to http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxyerroroverride this could be possible with mod_include, but I couldn't find

Apache RedirectMatch, ErrorDocument .etc doesn't work for the unsual query string

怎甘沉沦 提交于 2019-12-11 23:55:45
问题 www.mysite.com/something.do?name=%25'%20and%201=1%20-- This url contains an unusual query string for security test. Apache shows its default error page : 400 Bad Request . But I need to show my own error page. I tried several things but all failed, keeps showing apache default error. 1. ErrorDocument 400 /myErrorPage 2. RedirectMatch --$ /myErrorPage 3. RewriteEngine On RewriteRule --$ /myErrorPage 4 RewriteEngine On RewriteCond %{THE_REQUEST} --$ RewriteRule ^(.*)$ /myErrorPage My apache

How can I get ErrorDocument in .htaccess to output wrong uri parameter?

点点圈 提交于 2019-12-11 12:20:08
问题 I've worked-around the solution to transform all uri to one page via ErrorDocument. The reason behind this is to send Files AND folders (nice urls) to one page. However, I need the URI string to be sent to index.php?uri=string . Is this possible via ErrorDocument, or how do I do this? So I need to rewrite the http://www.something.com/games/specific-game to http://www.something.com/index.php?uri=/games/specific-game Is this possible at all, if, how? 回答1: If your server supports server-side