Apache .htaccess 404 error redirect -
i'm trying make htaccess file redirect 404 errors through index.php. page user failed access appended index.php's url can find out page request failed.
for example, if tried access http://example.com/doesntexist.php, apache should redirect them http://example.com/index.php/doesntexist
this have:
rewritecond %{request_filename} !-l rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule .* index.php?%{query_string} [l]
this works on 1 of webhosts failed when transfered site webhost (godaddy).
thanks guys
i can't test right now, according this answer, when set a
errordocument /404.php
(or index.php, doesn't matter)
the $_server["request_uri"]
variable contain original, failed request.
Comments
Post a Comment