Welcome Guest, Not a member yet? Register   Sign In
How to have a trailing slash at the end of the URL??

i want to have a trailing slash at the end of my url...
<?=anchor('main/show_all/','Show All');?>

but still at the end of the url for example where the link is it only shows


the one i want to do is


so anyone have an idea?how to do this?thx

<?=anchor('main/show_all/','Show All').'/';?>


nope not working

I would just be inclined to do it the 'normal' way - its barely much more code..

<a href="&lt;?=site_url(); ?&gt;main/show_all/">Show All</a>

You can do it the following way but I am guessing it will still remove the '/'

<a href="&lt;?=site_url('main/show_all/'); ?&gt;">Show All</a>

here is a novel approach, untested tho

why not set the url suffix to /
In the config file
$config['url_suffix'] = '/';
Then as long as you use site_url or the other CI functions that return a url all urls will end with /

@tonanbarbarianhehe it works thx very much

Theme © iAndrew 2016 - Forum software by © MyBB