My goal is to redirect any URL that does not start with a specific symbol ("#") to a different website. I am using Firebase Hosting and already tried the Regex function in redirect to achieve this. I followed this firebase documentation on redirects but because I new to regular expressions I assume that my mistake might be my regex code.
My Goal:
- mydomain.com/anyNotStartingWith# => otherdomain.com/anyNotStartingWith#
- mydomain.com/#any => mydomain.com/#any
My Code:
{
  "hosting": {
    ...
    "redirects": [
      {
        "regex": "/^[^#]:params*",
        "destination": "otherdomain.com/:params",
        "type": 301
      }
    ],
    ...
  }
}
 
    