Kilwa
Kilwa

Reputation: 95

Robots.txt for WordPress when not in root directory

If the WP install is not in the root (lets say it’s in /newsite/ like in http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory ) where does the robots.txt file go (root or instal folder) and what are the paths to be:

Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /wp-content/plugins/

OR

Disallow: newsite/wp-admin/
Disallow: newsite/wp-includes/
Disallow: newsite/wp-content/plugins/

Thank you!

Upvotes: 0

Views: 1044

Answers (2)

Sebastian
Sebastian

Reputation: 17443

robots.txt need to be always accessible from the root of your domain e.g.:

http://www.example.de/robots.txt

W3C docs

Upvotes: 1

Adrian Preuss
Adrian Preuss

Reputation: 3113

For example, your Site is reachable under www.example.com under the directory /var/www/ and your WordPress-Blog is under /var/www/newsite/, than put the robots.txt in /var/www/ and change the folders in there:

 Disallow: /newsite/wp-admin/
 Disallow: /newsite/wp-includes/
 Disallow: /newsite/wp-content/plugins/

Why /newsite/wp-admin/ and not /var/www/newsite/wp-admin/ for example? The directory is relative from the URI like http://www.example.com/newsite/

Upvotes: 1

Related Questions