Make WordPress Core

Changeset 1802


Ignore:
Timestamp:
10/15/2004 03:16:01 AM (20 years ago)
Author:
rboren
Message:

If the match is unanchored and greedy, prepend rewrite conditions to avoid infinite redirects and eclipsing of real files. Add L to rewrite flags to break out of rewriting once a match is found.

File:
1 edited

Legend:

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

    r1799 r1802  
    15151515        $match = str_replace('.+?', '.+', $match);
    15161516
     1517        // If the match is unanchored and greedy, prepend rewrite conditions
     1518        // to avoid infinite redirects and eclipsing of real files.
     1519        if ($match == '(.+)/?$') {
     1520            $rules .= "RewriteCond %{REQUEST_FILENAME} !-f\n" .
     1521                "RewriteCond %{REQUEST_FILENAME} !-d\n";
     1522        }
     1523
    15171524        if (strstr($query, 'index.php')) {
    1518             $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA]\n";
     1525            $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n";
    15191526        } else {
    1520             $rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA]\n";
     1527            $rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA,L]\n";
    15211528        }
    15221529    }
Note: See TracChangeset for help on using the changeset viewer.