PHP code example of tlovett1 / safe-redirect-manager

1. Go to this page and download the library: Download tlovett1/safe-redirect-manager library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tlovett1 / safe-redirect-manager example snippets


add_filter(
	'srm_default_direct_status',
	/**
	 * Set the default redirect status to 301 (Moved Permanently).
	 */
	function() {
		return 301;
	}
);

add_filter( 'srm_check_for_possible_redirect_loops', '__return_true' );

add_filter( 'srm_redirect_only_on_404', '__return_true' );