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

Brendan O'Brien
Brendan O'Brien
9,066 Points

Moved shirts4Mike to subfolder, not working now

Hello everyone, I'm working through the PHP development and I've worked on cleaning up the URL section. Now I wanted to change the folder MAMP uses and I moved the shirts4mike site to the new folder.

Now the site isn't working properly. I think it's a problem with the BASE_URL element created in the config.php

3 Answers

Logan R
Logan R
22,989 Points

I would try changing Base_URL from "/" to "/treehouse/". I would also try doing the same for the Root_PATH.

I hope this helps!

Brendan O'Brien
Brendan O'Brien
9,066 Points

Tried it out, and it didn't seem to make a difference. It was my understanding too that by setting the base url and root path like that then it should be able to be moved to any folder... no?

Logan R
Logan R
22,989 Points

Could you please give the url for your Base_URL? Where is the directory? Is it "/localhost/foldername/project.php"? More information would be nice, lol.

Thanks!

Brendan O'Brien
Brendan O'Brien
9,066 Points

Thanks, this is the config file I have:

<?php

    define("BASE_URL","/");
    define("ROOT_PATH",$_SERVER["DOCUMENT_ROOT"] . "/");

Yeah the site was just in localhost before, then I moved it to localhost/treehouse/

Brendan O'Brien
Brendan O'Brien
9,066 Points

L R, Hey you were right. I was just making some mistakes in the folder names.

Thanks for the help.

Logan R
Logan R
22,989 Points

Glad it worked and I could help :)

If you have any more questions, always feel free to ask!