Welcome Guest, Not a member yet? Register   Sign In
Remove index segment from url
#1

Hello!

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?

Thanks!
Reply
#2

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.
Reply
#3

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!
Reply
#4

(This post was last modified: 03-04-2016, 05:42 AM by PaulD. Edit Reason: Added url )

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.
https://support.google.com/webmasters/an...9066?hl=en
Reply
#5

Just customize route.php in config folder.
KeepĀ calm.
Reply
#6

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

or

make some redirect rules from index to without

or even set 404 error for test/index!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB