diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php
index 11c513d..cb8d1d2 100644
|
a
|
b
|
function redirect_canonical( $requested_url = null, $do_redirect = true ) { |
| 282 | 282 | while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $redirect['path'] ) || preg_match( "#/{$wp_rewrite->comments_pagination_base}-[0-9]+(/+)?$#", $redirect['path'] ) ) { |
| 283 | 283 | // Strip off paging and feed |
| 284 | 284 | $redirect['path'] = preg_replace("#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $redirect['path']); // strip off any existing paging |
| 285 | | $redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path']); // strip off feed endings |
| 286 | 285 | $redirect['path'] = preg_replace("#/{$wp_rewrite->comments_pagination_base}-[0-9]+?(/+)?$#", '/', $redirect['path']); // strip off any existing comment paging |
| | 286 | // only strip comments/ from comment feed on site |
| | 287 | if($redirect['path'] == preg_replace("#(https?:)?//[^/]+#","",get_feed_link('comments_rss2'))){ |
| | 288 | $redirect['path'] = preg_replace('#/(comments/)(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path']); |
| | 289 | } else { |
| | 290 | $redirect['path'] = preg_replace('#/(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path']); // strip off feed endings |
| | 291 | } |
| 287 | 292 | } |
| 288 | 293 | |
| 289 | 294 | $addl_path = ''; |