• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove index segment from url


Imagine we have Controller 'Test" with method 'index'

So it will be accessed in two way 'test/index' and just 'test', so we have duplicate content by same URL

Any suggestions?


this is the "normal way"
but www.exemple.com/test and www.exemple.com/test/index is not the same url...

if you don't want "test/index" and "test" respond to the same method, don't use index.

I suppose you could use a test in the method to reject calls that did not explicitly include "index," but why? What is the problem caused by duplicate content by the same URL?
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!

If the problem is one of duplicate content for SEO, you should use a canonical link in your page head to tell search engines which url you want the page to be recognized as.

Just customize route.php in config folder.
Keep calm.

Thanks guys for all answers!

So right decision would be use canonical link if we present on page with index in URL that point to page without index


make some redirect rules from index to without

or even set 404 error for test/index!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme ¬© 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.