WordPress.org

Make WordPress Core

Changeset 14273


Ignore:
Timestamp:
04/28/2010 06:37:15 AM (11 years ago)
Author:
nacin
Message:

Don't serve dynamic robots.txt when WP is not installed at the root of a domain. props solarissmoke, fixes #13115

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/rewrite.php

    r14219 r14273  
    15651565            return $rewrite;
    15661566
    1567         // robots.txt
    1568         $robots_rewrite = array('robots\.txt$' => $this->index . '?robots=1');
    1569 
    1570         //Default Feed rules - These are require to allow for the direct access files to work with permalink structure starting with %category%
     1567        // robots.txt -only if installed at the root
     1568        $home_path = parse_url( home_url() );
     1569        $robots_rewrite = ( empty( $home_path['path'] ) || '/' == $home_path['path'] ) ? array( 'robots\.txt$' => $this->index . '?robots=1' ) : array();
     1570           
     1571        // Default Feed rules - These are require to allow for the direct access files to work with permalink structure starting with %category%
    15711572        $default_feeds = array( '.*wp-atom.php$'    =>  $this->index . '?feed=atom',
    15721573                                '.*wp-rdf.php$'     =>  $this->index . '?feed=rdf',
Note: See TracChangeset for help on using the changeset viewer.