ErrorDocument 404 /portal/error.php
ErrorDocument 500 /portal/error.php
RewriteEngine On
RewriteBase /
RewriteRule ^include/(.*)$ /portal/error.php [L,R=404]
RewriteCond %{QUERY_STRING} error=([^&]+)
RewriteRule ^(.*/error.php)$ $1/error/%1? [R=302,L] # test with a 302 to avoid caching until it's confirmed as working
RewriteRule ^(.*/error.php)/error/(.*) $1?error=$2 [R=404,L]
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} error=([^&]+) [NC]
RewriteRule ^(.*/error\.php)$ $1/error/%1? [NC,R=302,L] # test with a 302 to avoid caching until it's confirmed as working
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} error=([^&]+) [NC]
RewriteRule ^(.*) $1/error/%1? [NC,R=302,L] # test with a 302 to avoid caching until it's confirmed as working
if(!file_exists('bootstrap.php')){
header('Location:error.php?error=runtime-error');
die();
}
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} error=([^&]+) [NC]
RewriteCond %{QUERY_STRING} !redirect=done [NC]
RewriteRule ^(portal/error\.php)$ $1/error/%1? [NC,R=302,L] # test with a 302 to avoid caching until it's confirmed as working
RewriteRule ^portal/error\.php/error/(.*) /portal/error.php?error=$1&redirect=done [NC,L]
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} error=([^&]+) [NC]
RewriteCond %{QUERY_STRING} !redirect=done [NC]
RewriteRule (.*\.php)$ $1/error/%1? [NC,R=302,L] # test with a 302 to avoid caching until it's confirmed as working
#RewriteRule ^portal/error\.php/error/(.*) /portal/error.php?error=$1&redirect=done [NC,L]
RewriteCond %{QUERY_STRING} error=([^&]+) [NC]
capture the value of the "error" parameter and are then put back into the URL as %1 in the rewriterule. Can you please double check both those things are in place correctly?
if($_GET['error']=='runtime-error'){
echo '4565';
}else{
echo '123';
}
<?php die("<pre>".print_r($_GET, true)); ?>
then the output should be this (which is what I get):Array
(
[error] => houdini-disappearing-query-param
[redirect] => done
)
Array
(
[error] => houdini-disappearing-query-param
[redirect] => done
)
Array
(
)
ErrorDocument 404 /portal/error1.php
ErrorDocument 500 /portal/error.php
RewriteEngine On
RewriteBase /portal/
RewriteCond %{QUERY_STRING} error=([^&]+) [NC]
RewriteCond %{QUERY_STRING} !redirect=done [NC]
RewriteRule (.*\.php)$ $1/error/%1? [NC,R=302,L] # test with a 302 to avoid caching until it's confirmed as working
#RewriteRule ^portal/error\.php/error/(.*) /portal/error.php?error=$1&redirect=done [NC,L]
RewriteRule ^include/(.*)$ error.php [L,R=404]
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} error=([^&]+) [NC]
RewriteCond %{QUERY_STRING} !redirect=done [NC]
RewriteRule ^(portal/error\.php)$ $1/error/%1? [NC,R=302,L] # test with a 302 to avoid caching until it's confirmed as working
RewriteRule ^portal/error\.php/error/(.*) /portal/error.php?error=$1&redirect=done [NC,L]
Array
(
[error] => runtime-error
)
RewriteRule ^(.*error.php)\?error=(.*)