Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Enhancing a Simple PHP Application Cleaning URLs with Rewrite Rules Get Variables and Rewrite Rules

Wei-Ting Chen
Wei-Ting Chen
7,632 Points

How to know when should I use BASE_URL or ROOT_PATH?

Hi there, I know one is the root of the file and the other is the root of the server file,but how do you know when to use one or another? What's the difference in result?

1 Answer


BASE_URL is a part of an URL, address that you paste into the browser's address field.

ROOT_PATH is a file system path, path that you use to open files and folders in OS X Finder or Windows Explorer.

So, when you refer to urls, you need to use BASE_URL, but when you work with files and folders on server you should use ROOT_PATH.