Hardcoding a Link without a block

Permalink
I have looked through everything and still don't understand how you hardcode a link without using a block or the Scrapbook. Can someone please explain exactly how this is done for a newbie? Sorry if this is a stupid question.

 
jordanlev replied on at Permalink Best Answer Reply
jordanlev
What do you want to link to?

The easiest way to do this is add this code to your page type template:
<a href="<?php echo View::url('/path/to/page'); ?>">Click Here</a>

(make sure there is an initial slash preceding the path -- for example, to link tohttp://yoursite.com/about-us, pass in '/about-us', or to link tohttp://yoursite.com/employess/john-smith,... pass in '/employees/john-smith')

If you just want to link to your home page you can do this:
<a href="<?php echo DIR_REL; ?>/">Home</a>
weiala replied on at Permalink Reply
Thanks! That was really fast and works perfectly!
GBNT replied on at Permalink Reply
GBNT
When I use this method, it includes the "index.php" in the URL. Any way to do this without appending the index.php?

Thanks
marticps replied on at Permalink Reply
marticps
Enabling "Pretty URL"?

Read Enabling Vanity URLs / Pretty URLs from
http://www.concrete5.org/documentation/installation/installing_conc...

Martí
GBNT replied on at Permalink Reply
GBNT
Sorry, I should have stated that I already have pretty URL's enabled and they are working fine, only hardlinking with this method returns a non pretty URL, I was looking for a way that does just that, hardlink and keep the pretty URL...
jordanlev replied on at Permalink Reply
jordanlev
Yes, add the following line to your config/site.php file:
define('URL_REWRITING_ALL', true);
GBNT replied on at Permalink Reply
GBNT
Perfect! Thanks