title: How to get everything after an '@'-selector in the url in php
body: <p>I'm coding a CDN in PHP, it works this far, but I want to choose different versions by adding an '@' with the version behind it. How do I get the version String after the '@'.
  Example: <a href="https://cdn.steven2105.de/jquery@3.3.0" rel="nofollow noreferrer">https://cdn.steven2105.de/jquery@3.3.0</a></p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  $error = false;
  
  $path = str_replace("/", "", $_SERVER['REQUEST_URI']);
  
  switch($path) {
      case "jquery":
          $toOpen = "jquery/3.3.1/jquery.min.js";
          break;
      case "jquery@3.3.0":
          $toOpen = "jquery/3.3.0/jquery.min.js";
          break;
      case "vue":
          $toOpen = "vue/2.6.10/vue.min.js";
          break;
      case "bootstrap-css":
          $toOpen = "bootstrap/4.3.1/bootstrap.min.css";
          break;
      case "bootstrap-js":
          $toOpen = "bootstrap/4.3.1/bootstrap.min.js";
          break;
      case "baguettebox-css":
          $toOpen = "baguettebox/1.11.0/baguettebox.min.css";
          break;
      case "baguettebox-js":
          $toOpen = "baguettebox/1.11.0/baguettebox.min.js";
          break;
      case "popper":
          $toOpen = "popper/1.14.7/popper.min.js";
          break;
      default:
          $error = true;
          break;
  }
  
  if (!$error) { 
      header("Location: https://cdn.steven2105.de/libs/$toOpen");
  } else {
      include_once "website.php";
  }
  </code></pre>
  
  <p>EDIT: What should I do now? It doesn't work.</p>
  
  <p>I have different libaries in the path <a href="https://cdn.steven2105.de/libs/" rel="nofollow noreferrer">https://cdn.steven2105.de/libs/</a> e.g. <a href="https://cdn.steven2105.de/libs/jquery" rel="nofollow noreferrer">https://cdn.steven2105.de/libs/jquery</a> with files in it such like <a href="https://cdn.steven2105.de/libs/jquery/3.3.1/jquery.min.js" rel="nofollow noreferrer">https://cdn.steven2105.de/libs/jquery/3.3.1/jquery.min.js</a>. I'd like to access these links with a shorter prefix like <a href="https://cdn.steven2105.de/jquery@3.3.1" rel="nofollow noreferrer">https://cdn.steven2105.de/jquery@3.3.1</a>. If I use the '@' character it should redirect to the version in the directory <a href="https://cdn.steven2105.de/libs/jquery/" rel="nofollow noreferrer">https://cdn.steven2105.de/libs/jquery/</a> and if it's without the '@' it should redirect to the latest version. </p>
  
  <p>What is the easiest way?</p>