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 KortsAsked:
Who is Participating?
 
Jason C. LevineNo oneCommented:
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
 
Jason C. LevineNo oneCommented:
Where is the .htaccess file with the WordPress rewrite rules located?
0
 
Richard KortsAuthor Commented:
At the root, www.rain1.com

Thanks
0
 
Richard KortsAuthor Commented:
Perfect. I thought it would involve a change to .htaccess.

Thanks,

Richard
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.