• Resolved Shaun

    (@cyraxeon)


    I use wordpress a lot for work and we always tend to build the site/theme/etc on a dev server and move it to the production server upon completion.

    Having the wp blog url stored in the db leaves most of the site links broken until it is updated once the site is moved over. While not incapacitating it is slightly annoying. Recently I had to deal with trying to set up WP on a SSL host (which didnt go well at all), but the url seemed to never work (could have been a server setting redirecting).

    What I would propose is storing this variable in the wp-config.php file instead, it seems like it would be easier to update here even if you could not log into the wp-admin (yes I know you can manually do it via the db).

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You can.

    define('WP_SITEURL', 'https://example.com/wordpress');
    define('WP_HOME', 'https://example.com/wordpress');

    Most of the time, though, you build the site out on it’s own URL and then use the tricks in moving WordPress to solve that problem. Not like WP will run without the DB anyway ??

    Thread Starter Shaun

    (@cyraxeon)

    when WP pulls those values from the db is is just using the php define function to set them anyway?

    If thats the case I will always add those lines to my wp-config, however, when wordpress sets them from the db is it going to give errors? because im assuming it isnt using

    @define(‘WP_SITEURL’, ‘https://example.com/wordpress’);

    note the “@”

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    No, the config file overrides the database. You should be fine, and I’ve never needed to preface it with the @ symbol.

    Thread Starter Shaun

    (@cyraxeon)

    wow thats awesome!! thank you!! just set it up

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress URL Setting’ is closed to new replies.