websitings Posted June 9, 2006 Share Posted June 9, 2006 Greetings,My website displays dynamic content from urls like this:[a href=\"http://www.mydomain.com/index.php?f=whatever\" target=\"_blank\"]http://www.mydomain.com/index.php?f=whatever[/a]Is it possible to modify the htaccess so that if a url does not contain ?f a header 404 message instead of a 200 success could be presented to the agent requesting the url.Thanks for any assistance Quote Link to comment https://forums.phpfreaks.com/topic/11557-modify-htaccess-to-show-404-message/ Share on other sites More sharing options...
poirot Posted June 9, 2006 Share Posted June 9, 2006 I believe that if your Apache has mod_rewrite you can use it to redirect request without f= to a 404 style page, but I am not sure if you can change the response code to 404... Quote Link to comment https://forums.phpfreaks.com/topic/11557-modify-htaccess-to-show-404-message/#findComment-43744 Share on other sites More sharing options...
Fyorl Posted June 9, 2006 Share Posted June 9, 2006 [code]ErrorDocument 404/home/username/public_html/404/RewriteEngine onRewriteRule ^404(/)?$ /404.html [R]RewriteRule ^index.php[^?] /404.html[/code]If that doesn't work, let me know. You need to create a 404.html file in your main directory. Quote Link to comment https://forums.phpfreaks.com/topic/11557-modify-htaccess-to-show-404-message/#findComment-43749 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.