Question

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!

Was it helpful?

Solution

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/

OTHER TIPS

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

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

W3C docs

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top