Stopping 404 pages when adding get variable to the URL I have a Drupal 8 website with a URL like http://mywebsite.com/my-content-url/my-content-url. What I have done is adding a variable to the URL, making it like http://mywebsite.com/my-content-url/my-content-url/myvariable.

How do I get Drupal 8 to stop seeing /myvariable as a part of the URL and giving me a 404 error?
You need a menu callback that accepts the variable. For more info, take a look at the Drupal docs. 

Another way to do this is to pass your variable as a query parameter like http://mywebsite.com/my-content-url/my-content-url?var=myvariable. You can then use code to parse that parameter from the URL. You can get those parameters by using something like \Drupal::request()-&gt;query-&gt;all();