문제

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!

도움이 되었습니까?

해결책

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/

다른 팁

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

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

W3C docs

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top