I recently just built a brand new website and I want to redirect individual pages from my old site to the new one. Primarily for user experience but also to transfer search ranking from my old site to my new one. I am using .htaccess mod_rewrite to do this. The old site was not built by me and I am now finding out that many of the URLs have query strings.
In some cases, I want to simply drop all query strings for a URL and have them all direct to the same place. To do this, I used the following code:
RewriteCond %{HTTP_HOST} ^greatexperiencesbaltimore\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.greatexperiencesbaltimore\.com$ RewriteRule ^contact\.php*$ "http\:\/\/www\.eventplanningcatering\.com\/contact\-us\/?" [R=301,L]
This seems to work perfectly to ensure that OldSite.com/contact.php, OldSite.com/contact.php?page=catering, and OldSite.com/contact.php?page=birthday all redirect to NewSite.com/contact-us/
So here is where I am running into a problem. I have numerous scenarios where I need:
OldSite.com/catering.php to redirect to NewSite.com/catering/
OldSite.com/catering.php?page=wed to redirect to NewSite.com/wedding/
OldSite.com/catering.php?page=corp to redirect to NewSite.com/corporate-events/
OldSite.com/catering.php?page=bday to redirect to NewSite.com/birthday/
I have tried researching and looking for the answers for an entire day now and I am at a loss.
Could someone please assist me in figuring this out, or pointing me in the right direction as to what to do in my .htaccess file to accomplish this?
Thank you