#12256 closed defect (bug) (fixed)
robots.txt not generated without posts
Reported by: | willshouse | Owned by: | ryan |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 2.8.6 |
Component: | Query | Keywords: | |
Focuses: | Cc: |
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)
#1
@
15 years ago
- Component changed from General to Query
- Milestone changed from Unassigned to 3.0
- Owner set to ryan
#4
@
15 years ago
- Keywords needs-patch removed
- Resolution set to fixed
- Status changed from new to closed
I would not say "even". This is clearly a bug IMHO.
#5
@
15 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
dd32 indicated he wanted to review this further.
Note: See
TracTickets for help on using
tickets.
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.