I have a file or files, on my server that I want to hide temporarily or permanently from users and search engines using .htaccess
to redirect those pages to a 404
page. This means that any user or search engine robot that attempts to view the pages will instead see a 404
page.
Here are the lines I added to my .htaccess
file to redirect some files to a 404
page but it doesn’t seem to work:
RedirectMatch 404 antalya_apartment.php?bid=2&page=236
RedirectMatch 404 antalya_apartment.php?bid=3&page=129
Here is the .htaccess
code:
Options +FollowSymLinks +Indexes +MultiViews
RewriteCond %{QUERY_STRING} (^|&)bid=2(&|$)
RewriteCond %{QUERY_STRING} (^|&)page=236(&|$)
RewriteCond %{QUERY_STRING} (^|&)bid=3(&|$)
RewriteCond %{QUERY_STRING} (^|&)page=129(&|$)
RewriteRule ^/antalya_apartment.php?$ http://turkish-property-world.com/ [L,R=404]