Jump to content

modify htaccess to show 404 message


websitings

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.