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

How can I add a subfolder to my htaccess file?

Hi. I've been working on this web app for quite some time.

We've decided to put the app inside a subfolder in the main root called 'en' . Now I thought the routing would just work with the things I've included in my HTACCESS file, but unfortunately everything's gone wrong. The only working page is the home page. So for instance, when I want to go to my contact page, I now go to www.website.com/en/contact but I get sent to www.website.com/en/en

What have I done wrong? Can you please help me? Thanks in advance. My Htaccess is right below:

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteBase /en
RewriteCond $1 !^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]