errordocument

right order of rewrite rules in an htaccess file.

hi ! 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/(...

php errordocument redirect access post

I am using errordocument in .htaccess to redirect a certain not found case to my processing script. This particular not found contains post data, but I cannot access it in my processing script. The content-length header is set, but the data is not available in $_POST or in php://input. Using liveheaders, I can see that there are only tw...

How to use errordocument to redirect to a php file in the same folder?

I want to take requests for missing files in a specific folder and redirect them to program.php in that folder. This is a program I will use a lot in different places, and I would prefer to avoid specifying the name of the folder in the htaccess file. I have tried just putting: errordocument 404 program.php but the result is that the...

custom 404 page for nonexistent php files

Hi, I just tried to redirect nonexistent files on the server to my custom 404 page but it only redirects .html files. I used that in my .htaccess file: ErrorDocument 404 /404/404.html How can I redirect all nonexistent files (including .php) to my custom page? Thanks ...

ErrorDocument 404 Not Sending Referrer Information: PHP

I'm using a standard htaccess ErrorDocument 404 to redirect users to a new page. In order to customize the 404, I need to know their referrer information (from the page they Tried to visit). $_SERVER['HTTP_REFERER'] is empty I printed out all of my global variables and most contain the link to pageNotFound.php. How can I retrieve thi...

Custom 401 Error Page for SVN Server

I have SVN server running on one of my domains as svn.mydomain.com and would like to setup a 401 error document for when the user authentication fails. As svn isn't an actual folder or real subdomain, i'm confused as to where I can put the ErrorDocument 401 line. It doesn't have to be in the .htaccess file, if it will work I could put ...

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

Hi, 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.some...

.htaccess and custom ErrorDocument for different file types.

I'm wondering if it's possible to use mod rewrite along with the ErrorDocument deceleration to customize the error pages depending on what type of file is requested. For example a non-existent html or php file is requested Apache will give nice custom HTML page. But if a non-existent image, js, css, etc... file is requested then Apache...

Apache ErrorDocument not working for PHP 500 error

I have a number of ErrorDocuments setup in my .htaccess file for errors such as 404, 401, 403 etc which all redirect to my error page but the ErrorDocument set for a 500 error is never displayed when PHP reports a 500. The 500 code is sent to the browser and the output is blank. Is there something special I need to do to enable 500 error...

Single ErrorDocument directive to catch all errors (.htaccess)

Hello. Is there something like a wildcard directive to catch all possible errors and deal with them in a single custom error page? ErrorDocument 404 /error.php?code=404 ErrorDocument 403 /error.php?code=403 ... ErrorDocument NNN /error.php?code=NNN #possible use of RegExp? I know I probably won't be dealing with a lot of custom error...

404 ErrorDocument Problem

I have .htaccess already configured: ErrorDocument 404 error.php But whenever I go to an invalid page, it should display the 404 page, but it just shows: "error.php" Just blank white, just the text of the php file only... The file and .htaccess does exist. Inside error.php: <?php $title = "Error 404 - Page Not Found"; incl...

.htaccess cross browser

Hi, Im trying to load a custom error document for a 404 error using a .htaccess file on a linux server, the page gets the current page URL then redirects to another site (which is retrieved from a db) based on an id it retrieved from the URL. The current error documents are stored here: /error_docs/ - i dont have permission to upload...

How do i have Apache to do further handling of the error status set within the PHP script?

Hello! My environment is: shared hosting with PHP 5.2 installed as apache2handler I have ErrorDocuments configured: ErrorDocument 404 "Simply Not Found" # OR ErrorDocument 404 /errors/fancy-not-found.php # both variants works as expected However, most simple example from PHP manual doesnt want to cooperate with Apache2 and perform ...

ErrorDocument that points to the ZF controller

Hello, I have Zend Framework based application and I need to create combo .js files. So, folders tree is: /myuser/apps/zfapp_write /myuser/apps/zfapp_write/combos /myuser/apps/zfapp "zfapp_write/combos" folder contain .htaccess file with content like ErrorDocument 404 /myuser/apps/zfapp/combos/get-combo Thats why if I'll open lin...

ErrorDocument doesn't set REDIRECT_QUERY_STRING server variable

Hi, When I tried to open not existing page .htaccess redirects me to ZF controller, but $_SERVER['REDIRECT_QUERY_STRING'] variable not setted. Any ideas? ...

Apache ErrorDocument after auth_digest has run and failed in apache2.conf

Heya, how goes it? I'm having an issue with apache2. I have a bunch of sites working off virtual hosts on an apache2 box, and a few of them have apache auth setup. When it fails, I wanted to customize the error page (401?), and so I tried throwing in: ErrorDocument 401 "Woops" into the rule, but it didn't work. To make sure I tried th...

ErrorDocument doesn't seem to be working in my .htaccess

Can anyone advise please? I'd like to have the default page for visitors to my site as being index.php and for all non-existent pages the visitor should see errordoc.php So I've put this in the .htaccess: ErrorDocument 404 /errordoc.php Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^mysite\.org\.uk$...

Creating an error page for a subdomain that doesn't exist.

I've got a number of subdomains on one of my sites. When someone goes to a subdomain that doesn't exist, I want to redirect to a 404 page on my main domain. noexist.example.com --> example.com/404.php?subdomain=noexist (or without the query string if HTTP_REFERRER can give me that info) I'm running LAMP on a VPS with cPanel installed...