Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Let's say I have an ecommerce site that is already up and functioning, www.widgets.com but I don't like the shopping cart that I got with the host and instead want to use Wordpress and a Wordpress shopping cart plugin. I don't want the site that is up to come down but I would like to develop the Wordpress site on the same host account and same domain.

Is that possible?

Once the Wordpress site is all developed, how do I make it the root site?

share|improve this question
    
So the issues are that I don't want to take the current site down and I don't want to have to migrate an entirely configured Wordpress site over. If I developed the new WP site under a subdirectory would it be easy to make it the root site? –  newniffirg Mar 12 '12 at 14:46
    
If you are making sales from your old site you have to remember once your URL's change to the products, categories and possibly home page you're going to lost most of your rankings. You should generate redirects after you migrate to WordPress. But look at CS-Cart community edition it's much better than WP as a shopping cart. –  Anagio Mar 12 '12 at 15:26
    
I believe it is a simple solution if you are not concerned with your current rank, and more complex if you are. I would also make sure you have researched other shopping cart options, since WordPress is not well known for this (although getting better all the time) –  Drai Mar 12 '12 at 16:06
    
Can you please elaborate on what you mean by rankings? Are you referring to product rankings or page rankings? Please advise. Thanks so much! –  newniffirg Mar 12 '12 at 16:14
    
I gather it's page ranking. Don't need to worry too much about that as the site is relatively new and little has been done on the SEO front. –  newniffirg Mar 12 '12 at 16:16
add comment

2 Answers

It is actually very easy to load Wordpress from a subdirectory as the main site. You can install it at root/directoryname, protect that area while developing and then point the site there whe it is ready. The instructions are very clear in the WordPress Codex

share|improve this answer
    
I think this makes the most sense. Thanks so much or your answer! –  newniffirg Mar 12 '12 at 16:07
1  
Make sure you read and understand the other answers and comments on the page. There is some good advice there! –  Drai Mar 12 '12 at 16:13
add comment

This is an annoyingly complex process!

  1. Create the site under a sub directory or subdomain.

  2. When you're ready to go live use the htaccess code at the bottom of this post to redirect everyone but you to a maintenance page (replace the ip address with your own).

  3. Backup and then delete the existing site code from the root directory.

  4. Move the wordpress codebase into your root directory.

  5. Access your database via phpMyadmin or similar tool.

  6. Find the wp_options table, browse the contents for the siteurl field and update it to the new url.

  7. Now login to Wordpress, and change your permalinks setting to one of the other options, save it, then change it back to the original setting (this regenerates your wordpress htaccess settings).

  8. Use a link scanner tool, like XENU's link sleuth, to scan the site for any urls which point to the dev site and manually update them.

  9. Remove the maintenance page redirect code and you're good to go.

Done. It's a total pain the the backside, and the last step is down to the fact that wordpress auto generates absolute urls inside posts and pages on first save. You can go back after a save and change the urls to relative ones or search the database in phpMyAdmin to amend them, but the technique outlined above is safer and more reliable (bitter experience).

As @Drai says you can redirect from root to a subdirectory, but don't do it unless you really need to. Depending on the config you choose you can end up with Wordpress's self generated links to pointing the subdomain or directory all redirecting back via the root. This is a nightmare when you are trying to do permanent redirects to keep your pagerank in one piece during a migration phase and can screw up your analytics (you become your own referrer).

RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^1\.1\.1\.1
RewriteCond %{REQUEST_URI} !/temporary-offline\.html$
RewriteRule .* /temporary-offline.html [R=302,L]
share|improve this answer
    
In my experience the sub-directory doesn't cause any problems for WordPress. I have also seen it as a recommended way to install WordPress. If the new site matches the permalink structure from the original site, then they may not need to redirect old pages. Thoughts? –  Drai Mar 12 '12 at 15:59
1  
@Drai you're completely correct of course - but it's easy to bugger up the link structure accidentally or through forgetfulness. Perhaps my perspective is distorted because I tend to see more cocked up sites than working ones, so I err on the site of caution where I don't know the technical knowledge of the site owner. In my view this is ok for greenfield sites, but where sites are being replaced and a lot of re-directions are happening it can lead to a big mess and loss of pagerank. –  toomanyairmiles Mar 12 '12 at 16:08
    
@Drai I highly doubt that their WordPress install will match their current URL structure. Chances are it's currently using a file extension, and possibly dynamic numbers for the categories and products and or simply an ID. If it currently is SEO friendly and simply has a category or product name plus file extension it's still a problem. They'll need to generate redirects for all their URLs to the new site. If they are generating revenue now that's a shame to have to move it, which is why I suggest CS-Cart or Magento instead of WP. –  Anagio Mar 12 '12 at 16:10
1  
@anagio Yes it all depends on how complex the existing URL structure is. Could work without a hitch if planned carefully. –  Drai Mar 12 '12 at 16:15
    
The URL structure will end up being completely different on the new site. Minimal SEO work has been done so I'm not worried about that being an issue or losing ranking. –  newniffirg Mar 12 '12 at 16:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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