Welcome Guest, Not a member yet? Register   Sign In
Requiring trailing slash at end of URL
#1

[eluser]jplanet[/eluser]
I have come to find out that it is good practice for SEO purposes to have URL's which will only respond to one precise format. With Codeigniter, I am finding that I can always add a slash to the end of the URL so that:

www.example.com/controller/function

can also be successfully requested with:

www.example.com/controller/function/

For other reasons, I would very much like to require that the last slash IS always present, so that if someone requests the URL, it will transparently perform a 301 redirect to include the trailing slash, similar to what happens when you navigate to a URL which is a directory root.

Is this best done in the routes.php, htaccess, or with a custom function?


Messages In This Thread
Requiring trailing slash at end of URL - by El Forum - 12-30-2007, 01:57 PM
Requiring trailing slash at end of URL - by El Forum - 12-30-2007, 03:57 PM
Requiring trailing slash at end of URL - by El Forum - 12-30-2007, 08:01 PM
Requiring trailing slash at end of URL - by El Forum - 12-31-2007, 09:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB