Welcome Guest, Not a member yet? Register   Sign In
Routes Problem
#1

[eluser]davidIgniter[/eluser]

Hi,

When I'm using anchor, for example: anchor('form', goto form);
it's produce this path: "www.example.com/mysite/index.php/www.exmaple.com/mysite/index.php/form". how to fix it?

One more thing,
how can I get rid of the prefix "mysite/index.php" in the url
I want it to be: "www.example.com/myclass"

Thanks in advance ! Smile

#2

[eluser]davidIgniter[/eluser]
anybody?
plz
#3

[eluser]xwero[/eluser]
If your site is in a subdirectory of the root you can't remove the directory.

To remove the index.php you have to use a empty string for the index_page page setting in config.php and use an .htaccess file to let the server redirect all urls to the index.php files.

The anchor function is a disguised site_url function that generates an a tag. If you want to use the domain of the url you can use this function.
Code:
function domain($url='')
{
    $parts = parse_url(config_item('base_url'));
    $return = $parts['scheme'].'://'.$parts['host'];
    if( ! empty($url)){ $return .= '/'.$url; }
    return $return;
}




Theme © iAndrew 2016 - Forum software by © MyBB