Answers for "redirect wordpress site to another url"

PHP
1

wp_redirect to home page

function redirect_to_home() {
  if(!is_admin() && is_page('2')) {
    wp_redirect(home_url());
    exit();
  }
}
add_action('template_redirect', 'redirect_to_home');
Posted by: Guest on October-02-2020
0

wordpress logout redirect to home

// On functions.php of your child theme or in a code snippet:
add_action('wp_logout','auto_redirect_after_logout');
function auto_redirect_after_logout(){
  wp_redirect( home_url() );
  exit();
}
Posted by: Guest on July-15-2021
0

wordpress redirect all pages to new domain htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]
</IfModule>
Posted by: Guest on April-21-2021
0

wp php redirect my account page url to custom url

function custom_redirect() {
    global $wp;

    if( $wp->request == 'my-account' ) {
        wp_redirect( site_url( 'my-account/orders/' ) );
        exit;
    }
}

add_action ('template_redirect', 'custom_redirect');
Posted by: Guest on October-18-2021
0

inner pages redirecting to the https wordpress

My issue was resolved by checking the log file of the website and found the 
.htaccess permission was '640' and updated to the '755' and worked like charm!

Permission denied: [client IP:57563] AH00529: 
/var/www/html/WEB_FOLDER/public_html/wp-content/uploads/.htaccess 
pcfg_openfile: unable to check htaccess file, ensure it is readable and that 
'/var/www/html/WEB_FOLDER/public_html/wp-content/uploads/' is executable
Posted by: Guest on April-02-2021

Code answers related to "redirect wordpress site to another url"

Browse Popular Code Answers by Language