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

geoffrey
geoffrey
28,736 Points

rewrite shirt - 1step

Hello there, I'm using Linux mint and I'm stuck at the first step of the tutorial.

I checked if the rewrite rule was enabled with that command on my system

sudo a2enmod rewrite

It says It's the case, however, when I click the shirts link in the header, it redirects me to the folder, the list of its content. In other words it doesn't work.

My .htaccess is located at the root of my shirt4Mike website and I typed the rule the same as the video.

RewriteEngine On

RewriteRule ^shirts/$ /shirts/shirts.php

Anyone would have a good solution ?

1 Answer

geoffrey
geoffrey
28,736 Points

I've found the answer on my side.

Two things had to be changed. The first one is the fact I had to modify a configuration file of apache2 to make it working. I followed these steps : http://alexmansfield.com/linux/apache-mod_rewrite-in-ubuntumint

The line AllowOverride None needs to be set to All, which isn't the case by default.

Next, is the fact that as I don't have put the website at the root, but instead in a folder named shirts4Mike, I had to change my RewriteRule.

RewriteRule ^shirts/$ /shirts4Mike/shirts/shirts.php

Hope that's going to help some others folks.