WordPress.org

Support

Support » How-To and Troubleshooting » Dublicate content – Url works with tots and columns in it

Dublicate content – Url works with tots and columns in it

Viewing 1 replies (of 1 total)
  • Sorry about my first message being full of typos. Here is a solution I came up with:

    /**
     * Fix for urls ending in dots and colons
     */
    function redirect_dotted() {
    	global $wp;
    	$current_url = home_url( $wp->request );
    	$is_dot = substr($current_url, -1, 1);
    	if( $is_dot === '.' || $is_dot === ':' ) {
    		$clean_url = rtrim( $current_url, '.:' );
    		wp_redirect( $clean_url, 301 ); exit;
    	}
    	return;
    }
    add_action('wp', 'redirect_dotted');
Viewing 1 replies (of 1 total)
  • The topic ‘Dublicate content – Url works with tots and columns in it’ is closed to new replies.
Skip to toolbar