Fix Permalinks on page in the wordpress : (index.php/Index.php/page/2)

As can be seen, there are two index.php.
If it were possible to get the index.php to the start of the structure of permanent links may solve the case, but the WP does not accept that.
In the forums so you can find something to do, how to insert the formatting.php file (in wp-includes) the following line:

$url = str_replace('index.php/Index.php','index.php',$url);

 This line must be exactly in the position of the structure below:

function clean_url( $url, $protocols = null, $context = 'display' ) {
 $original_url = $url;
 
 /*****  Must be written here  ******/
  $url = str_replace('index.php/Index.php','index.php',$url);
 /*****  Must be written here  ******/
 
 if ('' == $url) return $url;
 $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
 $strip = array('%0d', '%0a', '%0D', '%0A');
 $url = _deep_replace($strip, $url);
 $url = str_replace(';//', '://', $url);
 /* If the URL doesn't appear to contain a scheme, we
  * presume it needs http:// appended (unless a relative
  * link starting with / or a php file).
  */

 if ( strpos($url, ':') === false &&
  substr( $url, 0, 1 ) != '/' && substr( $url, 0, 1 ) != '#' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) )
  $url = 'http://' . $url;

 // Replace ampersands and single quotes only when displaying.
 if ( 'display' == $context ) {
  $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);
  $url = str_replace( "'", ''', $url );
 }

 if ( !is_array($protocols) )
  $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');
 if ( wp_kses_bad_protocol( $url, $protocols ) != $url )
  return '';

 return apply_filters('clean_url', $url, $original_url, $context);
}

Leave a Reply

Your email address will not be published. Required fields are marked *