I am building a web application for questions and answers. Each question/answer page has all the required metadata for Facebook and Twitter, and we encourage users to share these pages.
I have a dilemma regarding the shared link structure:
Option 1 - subdomains
Use a questions.example.com
and answers.example.com
, followed by an ID and optional text. The text is ignored by the request, which only takes the id into account.
http://questions.example.com/<question_id>/<question_text>
http://questions.example.com/12345/how-long-is-the-queue # Example
http://q.example.com/12345 # Example
Option 2 - URL path
This is the format used by stackoverflow.com and trello.com:
http://example.com/questions/<question_id>/<question_text>
http://example.com/questions12345/how-long-is-the-queue # Example
http://example.com/q/12345 # Example
Server-wise, I can easily do both - I have a wildcard SSL certificate and Apache/NGinx configuration is pretty straightforward.
Which option - subdomains or URL path - is preferred for shareble links?
http://example.com/how-long-is-the-queue
as ideally each question would have unique text for the name wouldn't it?