Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Davide Pupparo
8,452 Pointsrewrite rule for the contact page
Hi everybody! I've successfully writen a RewriteRule for the contact "thank you" page, from /subfolder/contact/?status=thanks to contact/thanks/ . Then, I've changed the link produced by the contact page when someone submit the form, to match the pattern, from header("Location: " . BASE_URL . "contact/?status=thanks");
to header("Location: " . BASE_URL . "contact/thanks/");
Now I don't understand how the thank you message keeps displaying, since it's placed in the following conditional <?php if (isset($_GET["status"]) AND $_GET["status"] == "thanks") { ?>
<p>Thanks for the email! I’ll be in touch shortly!</p>
<?php } else { ?>
How can it now works if I removed the GET variable from the link? Thank you all!
1 Answer

Mauro Bonucci
5,953 PointsIts easy, i think your rewrite rule is not correct, is it like this?
RewriteRule ^shirts4mike/contact/thanks/$ /shirts4mike/contact/?status=thanks
Davide Pupparo
8,452 PointsDavide Pupparo
8,452 PointsSorry for the very bad formatting