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

[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
#2

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

Tongue
#3

[eluser]jigen7[/eluser]
nope not working
#4

[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>
#5

[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 /
#6

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




Theme © iAndrew 2016 - Forum software by © MyBB