<?php
	global $wpdb;
	$search_term = urldecode( stripslashes( untrailingslashit( substr( $_SERVER['REQUEST_URI'], 1 ) ) ) );
	$find = array( "'.html'", "'.+/'", "'[-/_]'" ); $replace = " ";
	$search_term = trim( preg_replace( $find, $replace, $search_term ) );
	$search_term_q = esc_js( $wpdb->escape( urlencode( strip_tags( $search_term ) ) ) );
	
	$redirect_location = get_home_url().'?s='.$search_term_q;
	get_header();
?>
	<div class="container main">
    	<div class="row">
        	<div class="main col-md-9">
            	<h1 class="section-title-lg"><?php _e( 'Oops.. there\'s nothing here', 'franz' ); ?></h1>
                <div class="term-description">
	            	<p><?php _e( "We couldn't find any content at this URL.", 'franz' ); ?></p>
                    <div class="alert alert-info">
                    	<p><i class="fa fa-spinner fa-spin"></i> <?php printf( 'Searching for the keyword %s ...', '<strong>"' . $search_term_q . '"</strong>' ); ?></p>
                    </div>
                </div>
            </div>
            
            <?php get_sidebar(); ?>
            
        </div>
    </div>
    
    <script type="text/javascript">
		setTimeout(function(){window.location.replace( "<?php echo $redirect_location; ?>" );},2000);
    </script>

<?php get_footer(); ?>