# Redirect all requests to index.html except for actual files and directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.html [L]


<IfModule mod_rewrite.c>
  RewriteEngine On


  # Capture the last segment of the URL path and set it as an environment variable
  RewriteRule ^(.*/)([^/]+)/?$ - [E=LAST_SEGMENT:%2]
</IfModule>


<IfModule mod_headers.c>
  # Set the cookie with the path based on the last segment of the URL
  #Header set Set-Cookie "myCookie=myValue; Path=/%{LAST_SEGMENT}e; HttpOnly; Secure; SameSite=Strict" env=LAST_SEGMENT

</IfModule>
