Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional segments at the beginning of route #120

Open
milutinovici opened this issue Dec 14, 2014 · 3 comments
Open

Optional segments at the beginning of route #120

milutinovici opened this issue Dec 14, 2014 · 3 comments
Labels

Comments

@milutinovici
Copy link

For example this pattern:
':language:/blog/post/{id}'
is matched when language is part of url
'en/blog/post/1'
but if language is ommited, (which would be equivalent of using the default language)
'blog/post/1'
the route isn't matched.

@corintho
Copy link

Not sure how this is going to be handled here, but on every other routing framework I've seen out there, any optional path parameters were only allowed in the end of the URL

@Standa666
Copy link

we are using similar doubled route for similar case ':language:/blog/post/{id}' and '/blog/post/{id}' where both triggers same target.
But be prepared for shuffled arguments.

@AhtiAhde
Copy link

Each URI should represent a single unique resource; now you duplicate the unique resource and this will hurt your search engine visibility.

The correct philosophy would be to have the route as '/blog/post/{id}?:language: or if you do not like GET parameters, you could have '/blog/post/{id}/:language:'

I believe Google Bot tries to discover get parameters (or path) regarding language, just like it does with paginated contents. If these are easily discoverable, the Google Bot will kind of reward you, since you will get less penalties for having similar looking pages with similar link structures at the content area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants