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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -