Nick,
Whoever told you that was … ah, wrong!
Specificity:
List the (functional) requirements for your redirections:
Redirect EVERYTHING from greatexperiencesbaltimore to eventplanningcatering? Why? If it’s a addon domain for EPC, keep it running! To me, it’s illogical (to me) to combine the two domains as I’d think that their content would be very different.
That said, the query string redirections should become moot.
While I’m not a fan of what it appears that you’re doing, let’s get past that to your “specifications”:
- If someone types in www.greatexperiencesbaltimore –> redirect
Redirect where?
- If someone types in http://greatexperiencesbaltimore –> redirect
Redirect where?
- On URLs from old site with query strings, I want each query to redirect to a certain page (regardless of whether www or http was used)
List of key/value pairs and their redirections?
WHY do you repeat the test on the domain for every request? Functionally, that only needs to be done once (then the query string redirections would be managed from EPC’s .htaccess (different DocumentRoot?).
RewriteCond %{HTTP_HOST} ^greatexperiencesbaltimore\\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\\.greatexperiencesbaltimore\\.com$
RewriteCond %{QUERY_STRING} !page=
RewriteRule ^catering\\.php$ "http://www.eventplanningcatering.com/catering/" [R=301,L]
RewriteCond %{HTTP_HOST} ^greatexperiencesbaltimore\\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\\.greatexperiencesbaltimore\\.com$
RewriteCond %{QUERY_STRING} page=corp
RewriteRule ^catering\\.php$ "http://www.eventplanningcatering.com/corporate-events/?" [R=301,L]
RewriteCond %{HTTP_HOST} ^greatexperiencesbaltimore\\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\\.greatexperiencesbaltimore\\.com$
RewriteCond %{QUERY_STRING} page=wed
RewriteRule ^catering\\.php$ "http://www.eventplanningcatering.com/wedding/?" [R=301,L]
RewriteCond %{HTTP_HOST} ^greatexperiencesbaltimore\\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\\.greatexperiencesbaltimore\\.com$
RewriteCond %{QUERY_STRING} page=mitz
RewriteRule ^catering\\.php$ "http://www.eventplanningcatering.com/private-event/bar-bat-mitzvah/?" [R=301,L]
RewriteCond %{HTTP_HOST} ^greatexperiencesbaltimore\\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\\.greatexperiencesbaltimore\\.com$
RewriteCond %{QUERY_STRING} page=off
RewriteRule ^catering\\.php$ "http://www.eventplanningcatering.com/event-venues-locations/off-premise/?" [R=301,L]
RewriteCond %{HTTP_HOST} ^greatexperiencesbaltimore\\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\\.greatexperiencesbaltimore\\.com$
RewriteCond %{QUERY_STRING} page=eth
RewriteRule ^catering\\.php$ "http://www.eventplanningcatering.com/private-event/?" [R=301,L]
Well, I’ve beaten the dead horse about the domains sufficiently except to say that, if this is in the GEB DocumentRoot’s .htaccess, each and every RewriteCond addressing the {HTTP_HOST} is not required (you’re getting the external redirect in every case based on the URI and query string value for page). Personally, I’d tighten-up the code on the query string values to ^page={value}$ unless you have something else in the query string with page in which case I’d use ^(.&)?page={value}(&.)$ to select only the page={value} from the string. Note that {value} represents the eth, off, mitz, wed and corp values.
Sorry if I got overly pedantic with you but your answer is for you AND other members who look at your threat so I need to get it technically correct and offer techniques for improvement.
Regards,
DK