0

The existing corporate website is a non-CMS, dreamweaver dinosaur, with the top level HTML pages residing in the web root directory: httpdocs/.

I recently installed WordPress, and the site can now be re-implemented, page by page, in WP. Of course all the new pages have URLs that show the wordpress installation directory, e.g. http://www.example.com/wordpress/contact-us/

All this while, the general public will be unaware of the under-construction site in the WordPress directory, and will continue to use the existing non-CMS site.

Question is, when the WordPress site is complete, what's the recommended way to replace the old site? i.e. make it accessible without the WordPress directory in the URL.

I'm assuming that what I've done so far is common best practice, if not, please let me know too.

UPDATE: I just found this: https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

Many people want WordPress to power their website's root (e.g. http://example.com) but they don't want all of the WordPress files cluttering up their root directory. WordPress allows you to install it into a subdirectory, but have your website served from the website root.

1 Answer 1

1

Once you transfer all data and database , you can easily fire below query to change all URLS from old site to new :

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

Kindly pass your actual old and new URL in above query. This is easiest way I always use to replace URLs when transfer site from once place to another.

For you it will be :

Old URL : www.example.com/wordpress/abc

New URL : www.example.com/abc

3
  • text-replacement in the database seems like a riskier method that I had expected. I wonder what you think of this WordPress doc page I just found: codex.wordpress.org/Giving_WordPress_Its_Own_Directory It seems to be just what I was asking for.
    – Doochz
    Commented Apr 15, 2015 at 9:24
  • For a corporate website without a blog, would you say that those 4 update queries would not be necessary?
    – Doochz
    Commented Apr 15, 2015 at 9:58
  • It has not concern with blog . when you are changing site from one domain to another , above queries will help you to change all URLs. Commented Apr 15, 2015 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.