trailing slash in $config['base_url'] and start slash in redirect() |
[eluser]searain[/eluser]
In configuration, URL to your CodeIgniter root. Typically this will be your base URL, WITH a trailing slash: $config['base_url'] = "http://www.your-site.com/"; In document http://ellislab.com/codeigniter/user-gui...elper.html redirect() if ($logged_in == FALSE) { redirect('/login/form/', 'refresh'); } // with 301 redirect redirect('/article/13', 'location', 301); My questions are: 1) the base_url already have a slash and the end, does redirect() needs a slash at the beginning? Is that duplicated? Or better practice is with or without start slash in redirect(), someone said need the start slash someone said no. What is the authenticate answer? Thanks! 2) It seems CodeIgniter already takes care of the case that if $config['base_url'], missing the trailing slash. Such as with or without trailing slash, base_url() would always return with trailing slash. What is the common error you can see if missing the trail slash in the $config['base_url']? Thanks! |
Messages In This Thread |
trailing slash in $config['base_url'] and start slash in redirect() - by El Forum - 08-01-2010, 06:22 PM
trailing slash in $config['base_url'] and start slash in redirect() - by El Forum - 08-01-2010, 08:28 PM
|