Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress Template robots.txt #3729

Closed
MattFSGROUP opened this issue Jun 29, 2023 · 4 comments · Fixed by #3739
Closed

WordPress Template robots.txt #3729

MattFSGROUP opened this issue Jun 29, 2023 · 4 comments · Fixed by #3739
Labels
feature New feature or request

Comments

@MattFSGROUP
Copy link

Describe the feature or change in detail

Hi,

Could I suggest a minor 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, WordPress sites that use a PHP-generated ‘robots.txt’ instead of a 'real' robots.txt file give a 404 error.

Cheers

Would you like to sponsor this feature to have it implemented?

No

@MattFSGROUP MattFSGROUP added the feature New feature or request label Jun 29, 2023
@jlguerrerosanz
Copy link
Contributor

Does this apply to sitemap.xml too?

@jaapmarcus
Copy link
Member

Does this apply to sitemap.xml too?

Should be not affected by any existing rules so it should do in on default

@MattFSGROUP
Copy link
Author

Does this apply to sitemap.xml too?

This change doesn't affect sitemap.xml, I think that works out the box. Will double-check that though when I get chance.

@jaapmarcus
Copy link
Member

It works fine:
Screenshot 2023-07-04 at 10 23 50

jaapmarcus added a commit that referenced this issue Jul 4, 2023
…Press Multisite subdir support (#3741)

* Fix: #3729 Missing robots.txt get redirected to WP
* [nginx/templates] Add WordPress Multisite subdir support (#3741)
Co-authored-by: h.udo <hudokkow@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants