CodeIgniter Forums
How to have a trailing slash at the end of the URL?? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: How to have a trailing slash at the end of the URL?? (/thread-5943.html)



How to have a trailing slash at the end of the URL?? - El Forum - 02-08-2008

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

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

http://goldmine/jigen/jigsdb/index.php/main/show_all

the one i want to do is

http://goldmine/jigen/jigsdb/index.php/main/show_all/

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


How to have a trailing slash at the end of the URL?? - El Forum - 02-08-2008

[eluser]ninjawebstudio[/eluser]
Code:
<?=anchor('main/show_all/','Show All').'/';?>

Tongue


How to have a trailing slash at the end of the URL?? - El Forum - 02-08-2008

[eluser]jigen7[/eluser]
nope not working


How to have a trailing slash at the end of the URL?? - El Forum - 02-09-2008

[eluser]Lone[/eluser]
I would just be inclined to do it the 'normal' way - its barely much more code..

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 '/'

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



How to have a trailing slash at the end of the URL?? - El Forum - 02-09-2008

[eluser]tonanbarbarian[/eluser]
here is a novel approach, untested tho

why not set the url suffix to /
In the config file
Code:
$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 /


How to have a trailing slash at the end of the URL?? - El Forum - 02-09-2008

[eluser]jigen7[/eluser]
@tonanbarbarianhehe it works thx very much