[resolved] Disable automatic redirect to siteurl? (5 posts)

  1. stefanminning
    Posted 7 years ago #


    I just upgraded to WP2.3 and everything went smooth, except that now my site redirects to what I have set in siteurl no matter what domain is actually called. I use one install of WP to output my site in several languages, and depending on the domain I choose which language to serve to the user... of course now they all get English, because that's where WP2.3 sends them to.
    Any ideas how I can disable this otherwise useful feature?


  2. remove_action('template_redirect', 'redirect_canonical');

    Add that to your theme's functions.php file. That disables the canonical redirection.

  3. stefanminning
    Posted 7 years ago #

    Thanks, that did the trick!

  4. nilsjeppe
    Posted 7 years ago #

    Hm, doesn't seem to work for me. Is there something else to do?

    Edit: Sorry, caching problem... Works.

  5. 3ring
    Posted 7 years ago #

    Hey Otto; this doesn't seem to be working for me - I am adding your suggested code to the first line after <?php in my functions.php file in the wp-includes folder. When I do this I get an error msg for all pages:

    Fatal error: Call to undefined function remove_action() in /u/m/acct/www.mysite.com/wp-includes/functions.php on line 4

    What am I doing wrong?

Topic Closed

This topic has been closed to new replies.

About this Topic