Changeset 1489 for trunk/wp-includes/functions.php
- Timestamp:
- 07/27/2004 11:37:45 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r1480 r1489 1353 1353 } 1354 1354 1355 function mod_rewrite_rules ($permalink_structure) { 1356 $site_root = str_replace('http://', '', trim(get_settings('siteurl'))); 1357 $site_root = preg_replace('|([^/]*)(.*)|i', '$2', $site_root); 1358 if ('/' != substr($site_root, -1)) $site_root = $site_root . '/'; 1359 1360 $home_root = str_replace('http://', '', trim(get_settings('home'))); 1361 $home_root = preg_replace('|([^/]*)(.*)|i', '$2', $home_root); 1362 if ('/' != substr($home_root, -1)) $home_root = $home_root . '/'; 1363 1364 $rules = "RewriteEngine On\n"; 1365 $rules .= "RewriteBase $home_root\n"; 1366 $rewrite = rewrite_rules('', $permalink_structure); 1367 foreach ($rewrite as $match => $query) { 1368 if (strstr($query, 'index.php')) { 1369 $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA]\n"; 1370 } else { 1371 $rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA]\n"; 1372 } 1373 } 1374 1375 $rules = apply_filters('rewrite_rules', $rules); 1376 1377 return $rules; 1378 } 1379 1355 1380 function get_posts($args) { 1356 1381 global $wpdb;
Note: See TracChangeset
for help on using the changeset viewer.