PDA

View Full Version : How to handle domain structuring during development



tpman
03-19-2011, 09:54 AM
Hello,

I wanted to get some advice on how I should go about structuring the domain URLs for the websites I am developing for a client.

- Background -
Currently, my client has a website on another host provider with the primary domain name trueprecision.net and a second domain name stealthhubs.com that redirects to the primary domain. The website is a machine shop and a bicycle component business. For the future, the client would like to break this site up into two distinct sites, one for the machine shop and one for selling bicyle components (ecommerce).

I created two new domains trueprecisonmachining.com (machine shop site) and trueprecisioncomponents.com (bicyle components ecommerce site). The trueprecisioncomponents.com temporarily is the primary/account domain. For go-live, we are going to make the old domain, trueprecision.net the primary/account domain and move trueprecisioncomponents.com to a sub-domain. So when people go to the old known domain, they will have the option to go to the machine shop or bicycle component site sub-domains.

- Issue -
My issue is I am using Wordpress for the sub-domain site trueprecisioncomponents.com which uses absolute urls. Being that the URL is not assigned to the sub-domain yet, if I use that domain to build the Wordpress site its current url path is http://www.trueprecisioncomponents.com/
(wordpress root directory) for the site root. Once I move the domain over as a sub-domain, the Wordpress directory name will not be included for the site root. Which means all my urls pointing to assets within the site will be incorrect. I normal web development I would be using relative path urls. But Wordpress does not fair well with relative paths.

Any suggestions how I should handle urls paths during development in Wordpress? There are many ways to get around the issue, but I am looking for the least intrusive way. I am aware there is a Wordpress plugin that will run through your DB and do a find and replace for specific url paths. I would like to avoid this if it is possible.

Any suggestions would be much appreciated, Thank you,

Keith

farcaster
03-19-2011, 10:02 AM
I think all you would need to do is make the appropriate changes in the admin panel of Wordpress - permalinks, etc. Then an edit of the database using phpmyadmin from cPanel should allow you to make any other changes required. You would essentially be "moving" the Wordpress installation and there are specific instructions on how to do that at the Wordpress forums and codex. An understanding of the principals involved make the task easy and straightforward.

tpman
03-19-2011, 10:33 AM
Thank you for your suggestion!
Well, I'm not really moving a Wordpress installation. I will just be assigning a sub-domain name to the wordpress directory. There is a pretty easy to use Wordpress plugin called Velvet Blues Update URLs http://wordpress.org/extend/plugins/velvet-blues-update-urls/ that I have tested and it seems to work well. But I wanted to see if there was a simplier way to get around having to do this. Like doing aliasing or redirects. Anytime you systematically do a find and replace you have a potential of something going wrong. But if it's the simpliest way, so be it. I was even toying with the idea of buying another domain to temporarily become the primary/account domain and then freeing up the trueprecisioncomponents.com domain to assign it to the sub-domain of the WP site. For $10, it might be the least expensive way to go without eating up much time.

farcaster
03-19-2011, 10:48 AM
Because Wordpress embeds urls into the database, you need to deal with making changes to it when you perform these kinds of actions. You may get lucky and be able to effect the changes you need from the admin panel, but the experience that I have had is that you will have urls in the database that won't get changed. The find/replace should be for the front end of the url and can usually be done with a single find and replace in phpmyadmin - but again, check the wordpress site for this information.

Now, all that said, be aware of the differences between subdomains and addon domains. There are differences in the way they can be accessed on the web. I have a post somewhere that explains the difference. I'll try to find it and post the link.