diff --git a/utils/robots_perso.py b/utils/robots_perso.py index 1f8212d7..2d74b90e 100755 --- a/utils/robots_perso.py +++ b/utils/robots_perso.py @@ -19,8 +19,11 @@ def add_robots(user, robots): for user_agent in entry.useragents: for rule in entry.rulelines: what = "Allow" if rule.allowance else "Disallow" - robots["User-agent: %s" % user_agent][what].append("/%s%s" % (user, rule.path)) - robots["User-agent: %s" % user_agent][what].append("/~%s%s" % (user, rule.path)) + path = rule.path + if not path.startswith('/'): + path = '/' + path + robots["User-agent: %s" % user_agent][what].append("/%s%s" % (user, path)) + robots["User-agent: %s" % user_agent][what].append("/~%s%s" % (user, path)) def write_robots(file, robots): for user_agent, whats in robots.items():