#12256 closed defect (bug) (fixed)
robots.txt not generated without posts
| Reported by: | willshouse | Owned by: | ryan |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.0 |
| Component: | Query | Version: | 2.8.6 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
when there are no posts and only pages, robots.txt is not available (try accessing it via the browser) even when entries are being generated by the hook 'do_robots'
To fix the problem, create one published post. to re-create the problem, delete or un-publish the post.
I have been using WP for some sites which are only pages and no posts and so i believe it will be important to fix this issue. after all,
wordpress did win the award for best cms this year ( http://wordpress.org/development/2009/11/wordpress-wins-cms-award/ )
Change History (9)
#4
@
17 years ago
- Keywords needs-patch removed
- Resolution → fixed
- Status new → closed
I would not say "even". This is clearly a bug IMHO.
#5
@
17 years ago
- Resolution fixed
- Status closed → reopened
dd32 indicated he wanted to review this further.
On a robots request, WordPress appears to make a SQL request for the same as it would on a Home index page.
handle_404() throws a 404 if there are 0 posts matched.
Ideally, WordPress should not query the database for posts on robots.txt requests.
I'll commit a change to display the robots.txt page with 0 posts, but I'd prefer to see something happen about that Querying.. It might require an extra internal request var, along the lines of 'plugin-handled-no-404' or something.. Pure thoughts there.