[wp-trac] [WordPress Trac] #35437: dot in permalinks

WordPress Trac noreply at wordpress.org
Tue Jan 8 13:53:11 UTC 2019


#35437: dot in permalinks
-------------------------+-----------------------------
 Reporter:  vk_code      |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Canonical    |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:
-------------------------+-----------------------------

Comment (by cleancoded):

 Here is a trick. You can add these line to your index.php file

 {{{
 $URL = $_SERVER['REDIRECT_URL'];
 if (strpos($URL, '.') !== false) {
         $newURl = str_replace('.', '', $URL);
         header('Location: '.$newURl);
         $redirect = '<html><head><title>Redirecting</title><meta http-
 equiv="refresh" content="0; url='.$newURl.'" /></head><a
 href="'.$newURl.'">Redirect</a></html>';
         die($redirect);
 }
 }}}

 now index.php file looks like
 {{{
 <?php
 /**
  * Front to the WordPress application. This file doesn't do anything, but
 loads
  * wp-blog-header.php which does and tells WordPress to load the theme.
  *
  * @package WordPress
  */

 /**
  * Tells WordPress to load the WordPress theme and output it.
  *
  * @var bool
  */
 define('WP_USE_THEMES', true);

 $URL = $_SERVER['REDIRECT_URL'];
 if (strpos($URL, '.') !== false) {
         $newURl = str_replace('.', '', $URL);
         header('Location: '.$newURl);
         $redirect = '<html><head><title>Redirecting</title><meta http-
 equiv="refresh" content="0; url='.$newURl.'" /></head><a
 href="'.$newURl.'">Redirect</a></html>';
         die($redirect);
 }

 /** Loads the WordPress Environment and Template */
 require( dirname( __FILE__ ) . '/wp-blog-header.php' );



 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/35437#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list