Welcome Guest, Not a member yet? Register   Sign In
why redirect() removes trailing slash ?
#1

[eluser]Mahmoud M. Abdel-Fattah[/eluser]
when I use
Code:
redirect('/auth/login/', 'location', 301);
it redirects to
/auth/login ( without trailing slash !!)
#2

[eluser]Phil Sturgeon[/eluser]
CodeIgniter sites do not use trailing slashes by default. They are generally a bad idea anyway as they show s directories instead of files.

You only need to do this to redirect:

Code:
redirect('auth/login', 'location', 301);

This is the same for any URL created by CodeIgniter such as anchor, and form_open.
#3

[eluser]Mahmoud M. Abdel-Fattah[/eluser]
I thought it's better for SEO !
#4

[eluser]Phil Sturgeon[/eluser]
It doesn't make any difference to SEO. The point is to get the URL's as much like a title or keywords as possible without too many random characters confusing it.

Things like - and _ make a difference as _ is removed and - separates words. Slashes also separate words and are useful in Google Analytic as they help with content drilldown. Other than that there is no difference, and one on the end really doesn't do anything especially not improve SEO.
#5

[eluser]Mahmoud M. Abdel-Fattah[/eluser]
thanks a lot for this info Smile !




Theme © iAndrew 2016 - Forum software by © MyBB