Jump to content

[SOLVED] Robots.txt: how to allow one file from modules directory


Recommended Posts

I have installed module which list all comments from store on one page, they are listed on url /module/blockcomments/comments.php

 

BUT in robots.txt we all have disallow: /modules/

 

i've tried

 

Allow: /modules/blockcomments/comments.php

Disallow: /modules/

 

which should work - but it doesnt, what to do ?

Link to comment
Share on other sites

when i remove disallow: /modules/ then its fine:

 

Access allowed by line 18

Allow: /modules/blockcomments/comments.php

 

but with disallow: /modules line i got:

 

Access blocked by line 19

Disallow: /modules/

 

which means that robot is ignoring line 18 where i'm allowing to access one file, very strange

Edited by zaglebie (see edit history)
Link to comment
Share on other sites

The problem with your robots.txt file is the order. You are allowing a file, then disallowing it. They are read from the top down so you can set something and then unset it. What you basically need to do is reverse the order, have the disallow rule first then have the allow rule.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...