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! While you're at it, check out some resources Treehouse students have shared here.

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

PHP

Davide Pupparo
Davide Pupparo
8,452 Points

rewrite 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&rsquo;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!

Davide Pupparo
Davide Pupparo
8,452 Points

Sorry for the very bad formatting

1 Answer

Its easy, i think your rewrite rule is not correct, is it like this?

RewriteRule ^shirts4mike/contact/thanks/$ /shirts4mike/contact/?status=thanks