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 Sites

How to prevent search engines from indexing your staging server sites

Here are the configurations to prevent search engines (Google, Bing, etc.) from indexing all sites 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
No content available.
Tags
  • Laravel
  • Linux
  • Drupal
  • Database
  • Tips & Tricks
  • Mobile
  • Servers
  • SEO
Recent posts
  • How to prevent search engines from indexing your staging server sites
  • How to export Database with time-stamped file name in phpMyAdmin
  • How to reset a User password in a Laravel project from console
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 (4)
Projects
  • elmanager.tn
  • 365mathex.com
  • vpop.tn
  • toufoula.tn
  • writethemoney.com
  • dinartunisien.com
RSS feed

mahersakka.com © 2024