Mobile app version of vmapp.org
Login or Join
Candy875

: How to disallow hash fragments in robots.txt file I have a similar URL in my website that I want to stop all robots from crawling /review/dir/dir/dir/dir/#review-form The rules I've tried are:

@Candy875

Posted in: #RobotsTxt

I have a similar URL in my website that I want to stop all robots from crawling /review/dir/dir/dir/dir/#review-form

The rules I've tried are:


Disallow:/review/*review-form$
Disallow:/*#review-form$
Disallow:review-form$
Disallow:/#review-form


The bottom rule works but also blocks the URL without the hash fragment because the # symbol starts a comment.

How can I disallow a URL that has a hash fragment in the robots.txt file?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Candy875

1 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

SOURCE
Comments can be included at any location in the file using the "#" character.


You should be able to get around the issue by using URL Encoding and using the code %23, like so:


Disallow: /%23your-url/

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme