environment
Panel: 1 panel
Website: wordpress
SEO plugin: aioseo
question
Enter the URL: AAA.com/robots.txt and it will show 404 error
Workaround
Step 1: Enable AIOSEO Custom Robots.txt
- Enter the WordPress backend AIOSEO Plugin Panel → Tools → Robots.txt Editor.
- At the bottom of the page, check "Enable custom Robots.txt".
- Click Save changes, to ensure that the rules take effect.
Step 2: Verify WordPress Permalink
- Go to WordPress backend → set up → Permalink.
- No need to modify anything, click directly Save changes. (This will refresh WordPress' rewrite rules, ensuring
robots.txtDynamic path takes effect)
Step 3: Check NGINX configuration (via 1Panel)
- Log in to 1Panel management panel and enter "website" → Select your WordPress site → "rewrite" folder.
- exist
AAA.com.confAdd the following rule:
rewrite ^/robots.txt$ /index.php?aioseo_robots_path=root;- This rule ensures that all
robots.txtAll requests are forwarded to WordPress for processing.
- This rule ensures that all
Step 4: Clear cache and verify
Before I did this,Open AAA.com/robots.txt, it should display normally. If it still does not display normally, you can consider clearing the cache.
- Clear the server cache: If you use a cache plugin (such as WP Rocket, Redis), clear the cache.
- Clear your browser cache:according to
Ctrl + F5Force refresh the page. - access
https://yourdomain/robots.txt, confirm whether to display the content generated by AIOSEO.