wordpress - Access to txt is prohibited in Nginx, with the exception of the robots.txt file. How to write the rules?
某草草
某草草 2017-05-16 17:09:54
0
1
795

Attached are the current code rules, which prohibit access to language pack files and text files in WordPress, but also prohibit access to the website’s important robots.txt file. Although WordPress virtual robots.txt is used, It is also inaccessible. Can the Nginx master please give me some advice on how to write a judgment to exclude the robots.txt file?

  location ~* ^.+\.(po|mo|txt)$ {
      return 403;
  }
某草草
某草草

reply all(1)
伊谢尔伦
location ~* (\.txt)$ {
    location ~ robots\.txt$ {
    allow all;
    }
deny all;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!