Support » Requests and Feedback » siteurl & home options

  • As I was installing WordPress, it worked in less than 5 minutes as promised.

    When I then renamed and moved the folder, it broke in less than 1 minute.

    When you move the folders, in other words, when you change the URL, the system breaks. This is because in many places you use the siteurl and home options from the database. Whenever you move the WordPress code, you need to edit the database and fix the URL in there too.

    In itself, it is easy, but rather annoying. It seems to me that the wp-admin pages should not be affected by such a move. At least those pages that are required to fix the URLs mentioned. Then you could use the wp-admin to do the database update (much easier than doing an SQL UPDATE… but I know I’m complaining too much here…)

    Anyway, if you have that problem, you need to run this command:

    UPDATE wp_options SET option_value = ‘http://…’ WHERE option_name IN (‘siteurl’, ‘home’);

    Then go edit the home URL if you want a different one.

    It seems to me that the URL should not be necessary because it should always be available dynamically at run time. But I suppose that you have done this because you had the opposite problem…

    This was certainly the most annoying part as I was tweaking WordPress.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thank you Michael.

    What I can see in the pages you pointed out is that the siteurl and home options are there to stay and allow WordPress to be in one location and the index.php in another (btw, about the 2nd link Giving WordPress its own Directory, if my root site already has an index.php, I’m in big trouble… I would need a way to rename that file and have all the links point to that new name! but anyway… not my problem in this case!)

    The last link shows that I can use phpAdmin instead of direct SQL. I think I’m much better with direct SQL commands. What I was pointing out is the fact that between the time you move things and fix the database, WordPress cannot be used.

    On my end, I changed the get_option() function in wp-includes/functions.php so ‘siteurl’ and ‘home’ return a dynamically defined URL. To me that makes much more sense…

    if($setting == 'siteurl' || $setting == 'home')
                    // get_blog_name() is defined in wp-config.php
                    return '@PROTOCOL@@SERVER_NAME@@SCRIPT_NAME@/blog/' . get_blog_name();

    Now, be careful, because this prevents the installation from create the siteurl option and thus it looks like the installation does not work (if you keep that code when installing that is–just mentioning in case someone was silly enough to use this code!)

    Thank you.
    Alexis Wilke

    Don’t come and give advices to mess with the WP core files! Bad karma. Novice users are screwed up enough with the standard installation. 🙂
    No need for them to find this post and get even more confused.

    What I was pointing out is the fact that between the time you move things and fix the database, WordPress cannot be used.

    That’s 2 minutes if you know what are you doing and follow the instructions. No need to re-invent the wheel…

    Sorry… Did not mean to imply that WP is bad. But this one thing is a gotcha 😎

    I know you didn’t imply that. Don’t read more into my post than what is there.

    You come here and in your first 16 hours you only post topics about messing with the core files.
    I don’t like that because ignorant users will try it and then will come to cry here and the regular helpers will have to clean up the mess after you. It is that simple.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘siteurl & home options’ is closed to new replies.