Skip to content

Instantly share code, notes, and snippets.

@dannydover
Created September 2, 2019 20:37
Show Gist options
  • Select an option

  • Save dannydover/175a4e6b862fa3fa49fe1ee93bba81e9 to your computer and use it in GitHub Desktop.

Select an option

Save dannydover/175a4e6b862fa3fa49fe1ee93bba81e9 to your computer and use it in GitHub Desktop.
WordPress - Fix Infinite redirect on homepage (when using subdomain)
<?php
// Fix for infitite redirect of homepage when using subdomain. Thanks to andrewtaylor-1
// https://wordpress.org/support/topic/45-causes-infinite-redirect-on-static-front-page/
function disable_front_page_redirect($redirect_url) {
if( is_front_page() ) {
$redirect_url = false;
}
return $redirect_url;
}
add_filter( 'redirect_canonical', 'disable_front_page_redirect' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment