Need help with site URL, htaccess, redirection
-
I’m developing a WordPress/WooCommerce site to replace an existing HTML ecommerce site. Since it’s a big site with a few thousand products, we decided to start by building a WP site for only the wholesale products.
The current site is at example.com and the current wholesale products are static html pages in example.com/wholesale.
I wanted to be extra sure to not mess up the existing site while I was building the new one, so I installed WordPress in example.com/wp, and set the home page for the new wholesale WP site to example.com/wp as well, while I built the new site behind a “coming soon” page.
My idea was that when we were ready to launch the wholesale site, I could remove the old HTML files from example.com/wholesale and change the site URL in WordPress to example.com/wholesale. The existing html site would continue to live at example.com.
Then I could develop the retail section in a staging site, and when that’s ready I could migrate it to example.com/wp and change the site URL to example.com. Well, it sounded like a good plan….
I tried to launch the wholesale site today and discovered that the first part of the plan doesn’t work, since accessing example.com/wholesale doesn’t launch WordPress (it is still in example.com/wp).
So instead, I created a redirect in CPanel to redirect example.com/wholesale to example.com/wp. That gets visitors into the WordPress site, but the wholesale home page is still displayed as example.com/wp, and “wp” is used instead of “wholesale” in all the WooCommerce URLs. When I changed the site URL in WordPress to example.com/wholesale, I get a 404 error from the html (parent) site, because there is no HTML page with that name.
When the project is complete, I’d like to maintain WordPress in example.com/wp, display the new site at example.com, and display the wholesale catalog at example.com/wholesale.
I have a feeling this can be accomplished by editing the .htaccess file in either (or both) the example.com folder or the example.com/wholesale folder, but I’m unsure what to do. Any suggestions and guidance would be appreciated!
- The topic ‘Need help with site URL, htaccess, redirection’ is closed to new replies.