Created
September 2, 2019 20:37
-
-
Save dannydover/175a4e6b862fa3fa49fe1ee93bba81e9 to your computer and use it in GitHub Desktop.
WordPress - Fix Infinite redirect on homepage (when using subdomain)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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