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 Enhancing a Simple PHP Application Cleaning URLs with Rewrite Rules Adding A Trailing Slash

Ivan Dimov
Ivan Dimov
4,690 Points

Code challenge not working

I do everything as I have been taught in the videos and I try different possibilities and it always say that something is wrong. In addition, I cannot view anything in the Preview (I can't view a preview in many of the exercises)

Hi Ivan!

Could you show there your code? I hope then it would be easier to say what's wrong.

Preview? But what do you expect to see in the preview? This code challenge about page redirects.

3 Answers

Come on, guys! With this code challenge everything is all right.

The following code:

RewriteEngine  On
RewriteRule ^flavors/$ /all_flavors.php
RewriteRule ^flavors$ /flavors/ [R=301]

pass this code challenge. Check it out.

geoffrey
geoffrey
28,736 Points

I've just tested it, and It seems I can't pass it anymore. How I did some days ago :/

Ivan Dimov
Ivan Dimov
4,690 Points

I actually managed to complete it the same day, sorry for the late reply. I was skipping the 301 redirect. Thanks, Alexander.