I have used a custom html link More search results to link to the homepage. When clicking the link,I am taken to this urlhttp://localhost/homepage instead of the correct one localhost/cars/homepage What am I doing wrong? thanks

  • this is the html link I created <a href="/homepage">More search results</a> – sokratis Nov 1 '13 at 20:38
  • I don't understand the problem - If you want it to link to /homepage/cars, why are not using /homepage/cars as the href? – Clive Nov 1 '13 at 20:45
  • I want to link to localhost/cars/homepage and it sends me to localhost/homepage .It removes the "car" .My site is localhost/cars – sokratis Nov 1 '13 at 20:46

Your site is installed in the /cars folder, but you're pointing to the root of the server by using the forward slash at the front of your HREF. You should use Drupal's l() function to generate a proper link:

<?php echo l(t('Homepage'), 'homepage'); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.