Skip to main content
Maher Sakka's Blog
Main navigation
  • Home
  • Contact me
Language switcher
Breadcrumb
  1. Home
  2. Blog
  3. How To Prevent Search Engines From Indexing Your Staging Server Websites

How to prevent search engines from indexing your staging server websites

Here are the configurations to prevent search engines (Google, Bing, etc.) from indexing all websites on your server using global configuration for both web servers Apache and Nginx:

Prevent search engines indexing in Apache

Add the following line in httpd.conf or apache2.conf:

# Global no-index setting
Header always set X-Robots-Tag "noindex, nofollow, noarchive"

Prevent search engines indexing in Nginx

Add the following line in nginx.conf  in the http bloc :

http {
    # Global no-index setting
    add_header X-Robots-Tag "noindex, nofollow, noarchive, nosnippet, noimageindex" always;
    
    # ... other configurations ...
}

Web Servers, Apache and Nginx, must be restarted for changes to take effect.

Tags
  • Servers
  • SEO
  • Linux
Related posts
  • How to know which ini configuration files are loaded with PHP
Tags
  • Laravel
  • Linux
  • Drupal
  • Database
  • Tips & Tricks
  • Mobile
  • Servers
  • SEO
Recent posts
  • How to know which ini configuration files are loaded with PHP
  • How to prevent search engines from indexing your staging server websites
  • How to export Database with time-stamped file name in phpMyAdmin
Monthly archive
  • May 2017 (2)
  • August 2018 (1)
  • October 2020 (1)
  • August 2023 (1)
  • July 2024 (2)
  • November 2024 (1)
  • July 2025 (10)
  • October 2025 (5)
Projects
  • elmanager.tn
  • 365mathex.com
  • vpop.tn
  • toufoula.tn
  • writethemoney.com
  • dinartunisien.com
RSS feed

mahersakka.com © 2024 
Build Your IT Skills, Grow Your Wealth with Maher Sakka