Jump to content


Photo

modify htaccess to show 404 message


  • Please log in to reply
2 replies to this topic

#1 websitings

websitings
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 09 June 2006 - 05:55 AM

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

#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 09 June 2006 - 05:20 PM

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...
~ D Kuang

#3 Fyorl

Fyorl
  • Members
  • PipPipPip
  • Advanced Member
  • 273 posts
  • LocationUK

Posted 09 June 2006 - 05:25 PM

ErrorDocument 404
/home/username/public_html/404/
RewriteEngine on
RewriteRule ^404(/)?$ /404.html [R]
RewriteRule ^index.php[^?] /404.html

If that doesn't work, let me know. You need to create a 404.html file in your main directory.
[table]



Don't worry, the printer fairies will sort it out.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users