0

I need to block an entire Drupal 7 site from being indexed for a while. So, I think it is best to redirect everything to 404 instead of actually deleting all my files. How can I do that?

PS: using the following code on .htaccess does not seem to work.

RewriteEngine On
RewriteRule ^ - [R=404,L]

-- Update 03/04/2015 --
The server is nginx

5

If you are just trying to keep it from being indexed, you can just add

User-agent: *
Disallow: /

To the top of your robots.txt

  • This is one of a good option to use for being indexed, but I really need the 404. :( – CocoSkin Mar 4 '15 at 13:32
  • since the nginx does not support .htaccess, I'm going to mark this as my answer. Ty @Patrick Ryan – CocoSkin Mar 4 '15 at 14:33
0

You'll need to remove the existing Drupal rewrites for the moment; with them left in the .th access this code won't work.

  • I dont have anything in ".htaccess" beside those 2 lines of code. – CocoSkin Mar 2 '15 at 22:08
  • I updated the question. The site is running on nginx, not sure does it really matter. – CocoSkin Mar 4 '15 at 13:35
  • If the server is nginx .htaccess has no effect. – Alfred Armstrong Mar 4 '15 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.