• I recently transferred my blog to a different URL(shared host/ip) while still using the same database since its all under the same shared hosting environment. Now my issue is that one of my links point back to the previous location.

    Further detail:
    I have a post that when gets populated on the homepage has either a read more button to read the entire post or “watch video” link which gets swapped with the read more link with an if statement if a custom field checkbox has been clicked. It directs them to the right video page but now that i’ve pushed the site live, the “watch video” link is going to the staging server link.

    <?php if( get('video-cb')=='true' ) { ?>
    				<a href="<?php echo get_post_meta($post->ID, "video-url", true);?> "  class="get-link">Watch Video</a>
    				<?php } else {  ?>
    				<a href="<?php the_permalink() ?> "  class="get-link">Read More</a>
    				<?php } ?>
    				</div>

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter wordpreezy

    (@wordpreezy)

    Thanks for info.

    That’s a great tool. Seems kind of scary to search and replace database items though if you ask me. I’m wondering what would cause absolute url’s to exist because everything in the code is set for dynamic relative paths.

    I’d like to understand this so for future reference taking a wp site off staging servers and on to a live servers won’t produce any unexpected results.

    I’ve used those plugins many times, and they’re a bit easier than using PHPMyAdmin for quick database things.

    Absoulte paths for some URLs might be required for localhost; I’ve needed to use them under apache on OS X. If possible, you can use bloginfo functions in theme files and also in posts/pages if you use a plugin to exceute php; I use these all the time:

    <?php bloginfo('template_directory'); ?> returns the active template directory
    
    <?php bloginfo('url'); ?>  returns URL of web root
    
    <?php bloginfo('title'); ?> returns blog name

    From Template Tags/bloginfo « WordPress Codex

    Thread Starter wordpreezy

    (@wordpreezy)

    Thanks for the info. I’ll try the search regex plugin and see if that solves my issue. The site already live so hopefully nothing breaks in the process.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Transferred blog to different url but links still pointing to old site’ is closed to new replies.