php redirect / WordPress

The customer had an old non-wordpress site which had a folder called rsvp which did a redirect to a page in the old site.

In the new WordPress site, the equivalent location is this: http://rain1.com/new-site/customer-support/confirm-appointment/

So in the folder rsvp  on the server I put this index.php

<?php
// redirect to new Rain1 WordPress site RSVP page
header("Location: www.rain1.com/new-site/customer-support/confirm-appointment/");
exit;
?>

There is an htaccess page that (purposely) has this:

ErrorDocument 404 http://www.rain1.com/new-site

If I go to rain1.com/rsvp, I get the new site main page, NOT the desired page.

Why?

What is the correct way to do this?

Thanks
Richard KortsBusiness Owner / Chief DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jason C. LevineDon't talk to me.Commented:
Where is the .htaccess file with the WordPress rewrite rules located?
0
Richard KortsBusiness Owner / Chief DeveloperAuthor Commented:
At the root, www.rain1.com

Thanks
0
Jason C. LevineDon't talk to me.Commented:
At the root

So that's why it doesn't work.  The WordPress rewrite rules are firing on /rsvp/ and that generates a 404 error since there is not a matching WordPress page/post with that slug.  It never gets past that point and into your index page with the header command.

Edit .htaccess and add the following line above the WordPress rewrite block:

Redirect 301 /rsvp/ http://www.rain1.com/new-site/customer-support/confirm-appointment/

Open in new window


As long as that is above the WordPress rewrites, it should send users to the correct place.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Richard KortsBusiness Owner / Chief DeveloperAuthor Commented:
Perfect. I thought it would involve a change to .htaccess.

Thanks,

Richard
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WordPress

From novice to tech pro — start learning today.