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

Paul Yorde
Paul Yorde
10,497 Points

Web Addresses: clean URL's

Hi, I have a link that seems squirally. shirts.php in the breadcrumb navigation of the shirts detail page. All of the other files and links are responding correctly, but when this link is clicked, it seems to be throwing the product ID into the web address, i.e. – this error message:

"The requested URL /shirts_four_mike/shirts/102/shirts/ was not found on this server." Code for the link:

<a href="<?php BASE_URL; ?>shirts/">

on the shirt details page (shirt-buy) in this case

NOTE: I am usign a sub-directory as the parent folder as opposed to htdocs.

config.php if it helps:

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

Any ideas as to why this is happening?

Thanks, Paul

1 Answer

You probably need to echo that BASE_URL variable.

Paul Yorde
Paul Yorde
10,497 Points

Yes, that was it! I suspected that, but thought that it wouldn't need echoed since it was happening via a URL request. I guess I thought the href or something would just return the value of the CONSTANT.