Jump to content

Archived

This topic is now archived and is closed to further replies.

websitings

modify htaccess to show 404 message

Recommended Posts

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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
[code]ErrorDocument 404
/home/username/public_html/404/
RewriteEngine on
RewriteRule ^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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.