[wp-trac] [WordPress Trac] #18841: Sites with default permalinks do not return 'robots.txt'

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 17 05:06:02 UTC 2011


#18841: Sites with default permalinks do not return 'robots.txt'
--------------------------------------+------------------------------
 Reporter:  mbijon                    |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Permalinks                |     Version:  3.3
 Severity:  major                     |  Resolution:
 Keywords:  2nd-opinion dev-feedback  |
--------------------------------------+------------------------------
Changes (by mbijon):

 * keywords:  2nd-opinion => 2nd-opinion dev-feedback


Comment:

 Just got time to look into fixing this and there seem to be two ways to
 approach it. Can I get some feedback on what the preferred method might
 be?

 The options are below, either of them would basically add one .htaccess
 rule. The difference is if they're run from the Privacy or Permalinks
 pages:
 {{{RewriteRule ^robots\.txt$ /index.php [L]}}}

 (a) Add a new permalink structure to the WP_Rewrite class. Then from
 either WP setup or Options > Privacy we check to see if there's a non-
 default permalink structure in-use. If there's a structure this bug
 doesn't occur, and we do nothing. But if permalinks are on the default
 setting then the "robots_structure" is set.

 (b) Create a default permalink structure that attempts to set the one
 .htaccess rule noted above during WP setup, or when Options > Permalinks
 is set from anything back to default. This would be a bit more indirect
 than (a), but would probably require less code.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18841#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list