.htaccess - Htaccess 404 redirect not working, it doesnt redirect -


whit code, 404 redirect doesnt work. dont error. if type in url doesnt exists, empty white page.

code updated:

   <ifmodule mod_rewrite.c>     rewritebase /     rewritebase /     rewritecond %{request_filename} !-f       rewritecond %{request_filename} !-d       rewriterule ^(.*)$ htaccess.php?q=$1 [qsa]   </ifmodule>     <ifmodule mod_gzip.c>     mod_gzip_on yes     mod_gzip_dechunk yes     mod_gzip_item_include file .(html?|txt|css|js|php|pl)$     mod_gzip_item_include handler ^cgi-script$     mod_gzip_item_include mime ^text/.*     mod_gzip_item_include mime ^application/x-javascript.*     mod_gzip_item_exclude mime ^image/.*     mod_gzip_item_exclude rspheader ^content-encoding:.*gzip.* </ifmodule>   #rewriteengine on #rewritecond %{https} !=on #rewritecond %{request_uri} !^/[0-9]+\..+\.cpaneldcv$ #rewritecond %{request_uri} !^/[a-f0-9]{32}\.txt(?:\ comodo\ dcv)?$ #rewriterule ^.*$ https://%{server_name}%{request_uri} [r,l]   rewriteengine on rewritebase / errordocument 404 404.php/ rewritecond %{request_uri} ^/404/$ rewriterule ^(.*)$ 404.php [l] 

change errordocument 404 /index.php

rewriteengine on rewritebase /  errordocument 404 http://yourdomain.com/404.php/  rewritecond %{request_uri} ^/404/$ rewriterule ^(.*)$ /path/to/404.php [l] 

the rewrite rules map url 404.php script.

see link more information: http://httpd.apache.org/docs/current/mod/core.html#errordocument


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -