Welcome Guest, Not a member yet? Register   Sign In
routing issue
#1

[eluser]srisa[/eluser]
Hello,

I have a routing rule like this
Code:
$route['(:num)'] = "users/user/$1";
and it works as expected.

The problem is that two urls will be serving the same content. Not sure how big a problem that can be. What i want to do is to redirect the user to the other url. Is it possible to do it with the uri routing provided by CI?

I know that it can be done with .htaccess . After a little bit of research, i feel that it can be done by extending the CI_Router class. Which one do you think is better? Or is there any alternative?

Thank you.
#2

[eluser]Andrew Cairns[/eluser]
I would put a 301 redirect with .htaccess.
A page request would be required before a redirect would occur that would use the base_url within your config file.
Stick with .htaccess - it is your friend Smile
Also, google penalises duplicate content, so a 301 would make them happy.
#3

[eluser]srisa[/eluser]
Thanks Andrew.




Theme © iAndrew 2016 - Forum software by © MyBB