Wordpress Template robots.txt

Hi,

Could I suggest a small edit for the default Wordpress nginx template please?

Can we amend the following section

location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

To:

   location = /robots.txt {
        try_files $uri $uri/ /index.php?$args;
        log_not_found off;
        access_log off;
    }

Without this change, sites that use a PHP-generated ‘robots.txt’ instead of an actual robots.txt file give a 404 error.

Cheers

2 Likes

Hope you made this request through github, it can get missed on the forum

3 Likes

I haven’t but I will do!