Forum Moderators: phranque
IF ($GET["topic"] == '')
{HEADER ('HTTP/4.01 Not Found')}; only www.example.com/topic.php?id=101 or 102 or 103 should be shown to public as well as google,
# If topic.php is requested with an invalid query string, rewrite
# the request to a nonexistent filepath to force a 404 response
RewriteCond %{QUERY_STRING} !^id=[0-9]+$
RewriteRule ^topic\.php$ /a-filepath-which-does-not-exist [L]
# If topic.php is requested with an invalid query string, force a 404 response
RewriteCond %{QUERY_STRING} !^id=[0-9]+$
RewriteRule ^topic\.php$ - [R=404,L]
Options +FollowSymLinks -Indexes -MultiViews
RewriteEngine on