WordPress.org

Ready to get started?Download WordPress

Forums

x-robots noindex in .htaccess for specfic directories (2 posts)

  1. misterpatrick67
    Member
    Posted 3 years ago #

    Hello,

    I am trying to figure out how to get search engines to not archive or index specific secure categories using .htaccess. I can't seem to find the method for doing entire slugs/urls.

    As an example, here's preventing a single file (your sitemap.xml), so how do I remove a directory called http://www.myurl.com/secure?

    <IfModule mod_rewrite.c>
    <Files sitemap.xml>
    Header set X-Robots-Tag "noindex"
    </Files>
    </IfModule>

  2. Do it via robots.txt, not .htaccess

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.