WordPress.org

Ready to get started?Download WordPress

Forums

URL simplification (5 posts)

  1. Richard
    Member
    Posted 4 years ago #

    We are using WP on a hosted domain. On that hosted domain we have an add-on domain, and that is where the WP is used.
    It installed and is running fine.
    Our question is regarding the URL shown in a browser when the site is visited. When we open the homepage in a browser, we get a URL such as: http://yourdomain.com, as expected. When we follow any links we get instead a URL with the IP address, such as: http://IPaddress/~subdirectory/domain name/section/
    This works, but I'd prefer to have a more discreet and friendly URL.
    I contacted the hosting company, and they suggested going into the mySQL database table 'wp_options' and manually changing the 'Site URL' and 'Home' fields to what we wanted displayed in the browser URL display. That worked for solving that issue, but created other issues, such as as soon as we move off the homepage via a link on the homepage, we get a 500 error. Obviously, there's more involved than those two fields.
    Anyone know how complex this is going to get to be able to solve the first problem yet not upset the rest of the apple cart???

  2. Mark / t31os
    Moderator
    Posted 4 years ago #

    That'll be because all the post GUIDs still point at the old URL..

    Run this in phpmyadmin on the WordPress database (using the SQL tab).

    SELECT guid FROM wp_posts

    I think you'll find all the entries still point to the old URL..

  3. Mark / t31os
    Moderator
    Posted 4 years ago #

    Quick fix would be to use a search and replace query (you can copy and paste the code below directly into the SQL tab of phpmyadmin - be sure to select the WordPress database first).

    PLEASE BACKUP BEFORE USING:

    UPDATE wp_posts SET guid = replace(guid,'http://OLDURLHERE/','http://NEWURLHERE/') WHERE guid LIKE 'http://OLDURLHERE%'

    Update OLDURLHERE and NEWURLHERE as appropriate..

    Again, please backup before using.

  4. Richard
    Member
    Posted 4 years ago #

    Thanks!

    Give me a day to work it through. By this time of the day, my head swims 'this way', while my common sense swims 'that way'.

  5. Mark / t31os
    Moderator
    Posted 4 years ago #

    Assuming i've read your problem correctly, that's the only thing i could think of.

    Let me know if it helps, and please ... don't forget to backup your data first (just incase)..

Topic Closed

This topic has been closed to new replies.

About this Topic