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

Getting MAMPStack to work with a .htaccess file

I have MAMPstack 5.4.9 installed on my mac and am not able to my .htaccess file to work. I am trying to do the simplest test to check and make sure it is working and it seems to be ignoring the file. When I first creating the access file, my Mac did warn me indicating any file that starts with a ( . ) would be hidden, I am assuming that is just hidden in the finder so I cannot view it, the file should still exist to the programs installed.

In my root directory I have 3 files setup, test.html, test.php, and my .htaccess file. I am simply trying to test the .htaccess file by redirecting the test.html to test.php. Instead of redirecting it just loads the test.html page with no changes to the URL.

My https.conf file

#LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule php5_module modules/libphp5.so

<Directory "/Applications/MampStack.app/Contents/Resources/app/apache2/cgi-bin"> AllowOverride All Options Indexes FollowSymLinks </Directory>

My .htaccess file

RewriteEngine On RewriteRule ^/?test.html$ test.php [L]

2 Answers