WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. stefanminning
    Member
    Posted 6 years ago #

    Hi,

    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?

    Thanks,
    Stefan

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    remove_action('template_redirect', 'redirect_canonical');

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

  3. stefanminning
    Member
    Posted 6 years ago #

    Thanks, that did the trick!

  4. nilsjeppe
    Member
    Posted 6 years ago #

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

    Edit: Sorry, caching problem... Works.

  5. 3ring
    Member
    Posted 6 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

Tags