WordPress site redirect permalinks

I have a word-press site example.com and I am redirecting it to beta.example.com.

I want my links to be shown as example.com/link1 which was previously shown as beta.example.com/link1. I am getting the page URL with <?php echo get_permalink(id); ?> I tried to change site address and site URL but its not working. I also tried custom permalinks but its not working.

Read More

This is my first WordPress site I may be doing something wrong but I can not figure out what’s going wrong.

Related posts

Leave a Reply

3 comments

  1. WordPress can also store URLs in the database, in various locations. You can manually edit the database in most cases, but some are stored in serialized objects, which cant be (easily) edited by hand, so you can use a find and replace tool such as http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    Be very careful to read the instructions with that tool, take a backup beforehand and remove the script from the server when you are done.

  2. WordPress stores that info in:

    example.com/wp-admin/options-general.php

    The nice thing about WordPress is even if links in the front-end seem off, the admin area should be working. If not, then something is really amiss. But issues like this are fairly common with WordPress migrations.

    That said, I prefer to hard-code the install configuration info in the wp-config.php file. You can add the new URL basepath to your wp-config.php file like so:

    define('WP_SITEURL', 'http://example.com');
    define('WP_HOME',    'http://example.com');
    define('WP_CONTENT_URL', 'http://example.com/wp-content');
    

    I place those near the top of the file just above the database settings. I find that doing it this way makes easier to migrate sites from one URL to another.