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.
This is my first WordPress site I may be doing something wrong but I can not figure out whatâs going wrong.
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.
Check your .htaccess file in your root directory for any entries that may be redirecting your links to beta.yoursite.com
WordPress stores that info in:
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 yourwp-config.php
file like so: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.