Welcome Guest, Not a member yet? Register   Sign In
Routing URLs and trailing slashes
#1
Information 

Hello,

I have a little problem with codeigniter because I want to have urls like that http://site.com/dogs/ or http://site.com/cats/ etc.

So see my routes.php file :
PHP Code:
$route['([0-9a-zA-Z-_+]+)'] = "site/categorie/$1"

My htaccess file :
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [L]

My urls are working but I can access with this url http://site.com/dogs/ and this url http://site.com/dogs
But it's a big problem for duplicate content in SEO.

I already tried :
PHP Code:
$route['([0-9a-zA-Z-_+]+)/'] = "site/categorie/$1"

But it's doesn't work...

I am looking for a solution to for using trailing slashes for my urls.

Thank you for you help.
Reply


Messages In This Thread
Routing URLs and trailing slashes - by peter - 03-25-2015, 06:43 AM
RE: Routing URLs and trailing slashes - by Rufnex - 03-25-2015, 09:13 AM
RE: Routing URLs and trailing slashes - by peter - 03-25-2015, 11:12 AM
RE: Routing URLs and trailing slashes - by Rufnex - 03-25-2015, 12:02 PM
RE: Routing URLs and trailing slashes - by Narf - 03-26-2015, 04:07 AM
RE: Routing URLs and trailing slashes - by peter - 03-26-2015, 08:48 AM
RE: Routing URLs and trailing slashes - by peter - 03-27-2015, 07:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB