Title: Polylang incompatible with Development Site using db.php
Last modified: August 30, 2016

---

# Polylang incompatible with Development Site using db.php

 *  [sgurley](https://wordpress.org/support/users/sgurley/)
 * (@sgurley)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/polylang-incompatible-with-development-site-using-dbphp/)
 * I have a public site that is being worked on. I keep a local copy of WordPress
   to develop the theme and other files. This setup works great and I have it working
   for many wordpress sites. See [this link](https://codex.wordpress.org/Running_a_Development_Copy_of_WordPress)
   for how I did it.
 * In a nutshell, the above site leads you to add two filters (pre_option_home and
   pre_option_siteurl) that replace the url with the dev url. That way, the database
   gets the right URL (the live site) written to it and the dev site (my local computer)
   see links and whatnot linking to the local site.
 * This all fails when this Polylang option is on:
    The language is set from the
   directory name in pretty permalinks Example: [http://local-dev-site/blog/en/my-post/](http://local-dev-site/blog/en/my-post/)
 * That is, if my url is:
    [http://local-dev-site/blog/some-post-name/](http://local-dev-site/blog/some-post-name/)
   My code for a dev site vs a live site works fine.
 * If I turn that option on, the URL **SHOULD BE**:
    [http://local-dev-site/blog/es/some-post-name/](http://local-dev-site/blog/es/some-post-name/)
 * But instead it rewrites to:
    [http://live-site-domain.com/blog/es/some-post-name/](http://live-site-domain.com/blog/es/some-post-name/)
 * I believe polylang is seeing the /en/ (or /es/) and redirecting using something
   that my pre_option_home or pre_option_siteurl isn’t catching… thus the redirect
   goes to the true URL (instead of my local copy).
 * To solve this, I think either polylang needs to be tweaked to use something else
   to get the url or my db.php needs to be changed to add something other than pre_option_siteurl
   or pre_option_home.
 * Anyone have an idea?
 * [https://wordpress.org/plugins/polylang/](https://wordpress.org/plugins/polylang/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/polylang-incompatible-with-development-site-using-dbphp/#post-6223335)
 * Hi!
 * Try putting:
 *     ```
       define('PLL_CACHE_HOME_URL', false);
       ```
   
 * either in your wp-config.php or in a new file wp-content/polylang/pll-config.
   php
    See [https://polylang.wordpress.com/documentation/documentation-for-developers/list-of-options-which-can-be-set-in-wp-config-php/](https://polylang.wordpress.com/documentation/documentation-for-developers/list-of-options-which-can-be-set-in-wp-config-php/)
   for more information
 *  Thread Starter [sgurley](https://wordpress.org/support/users/sgurley/)
 * (@sgurley)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/polylang-incompatible-with-development-site-using-dbphp/#post-6223338)
 * That still doesn’t work. I have figured out more where it is in the polylang 
   code.
 * If I visit the URL:
    [http://my-local-site/blog/](http://my-local-site/blog/)
 * it doesn’t work – in trying to append the /en/ on the end, it fails and redirects
   to the public site.
 * If I visit my local URL
    [http://my-local-site/blog/en/](http://my-local-site/blog/en/)
 * It works fine. I could, in theory, fix this by making all my non-wordpress links
   to the /blog/ also include the language… is there something else I can do to 
   make polylang work correctly?
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/polylang-incompatible-with-development-site-using-dbphp/#post-6223372)
 * Could you try to resave your Polylang settings?
 *  Thread Starter [sgurley](https://wordpress.org/support/users/sgurley/)
 * (@sgurley)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/polylang-incompatible-with-development-site-using-dbphp/#post-6223398)
 * No change – restarted apache – cleared cache – no change. /blog/ doesn’t work
   but /blog/en/ works fine.
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/polylang-incompatible-with-development-site-using-dbphp/#post-6223474)
 * I looked at your codex link. I did not test but I believe that the filter pre_option_home
   breaks Polylang because it bypasses the home_url filter.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Polylang incompatible with Development Site using db.php’ is closed to
new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

## Tags

 * [db.php](https://wordpress.org/support/topic-tag/db-php/)
 * [multiple domains](https://wordpress.org/support/topic-tag/multiple-domains/)
 * [two domains](https://wordpress.org/support/topic-tag/two-domains/)

 * 5 replies
 * 2 participants
 * Last reply from: [Chouby](https://wordpress.org/support/users/chouby/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/polylang-incompatible-with-development-site-using-dbphp/#post-6223474)
 * Status: not resolved