Appending a character using a URL Forward Page Rule

Hello, I was wondering if the following is possible:

  1. ://mydomain.com/* -> ://www.mydomain.com/#/$1
  2. ://www.mydomain.com/*-> ://www.mydomain.com/#/$1

I currently have a page rule for #1 which works fine, but when I add #2 I get a too many redirects error, which is to be expected. I tried to get around this by explicitly requiring a forward slash, but it doesn’t seem to have any effect, e.g.

://mydomain.com/* -> ://www.mydomain.com/#/$1

vs.

://mydomain.com* -> ://www.mydomain.com/#/$1

Is what I’m trying to do (append a hash to the end of the URLs) possible using a URL Forward page rule?

Unfortunately, you can’t Wildcard Match a shorter URL with the same hostname to point to a longer URL with the same hostname. Your Example #2 has a wildcard that will match the hash in the forward to URL.

Also unfortunately, you can’t do excludes in matches.

Your best bet is to handle this at the server using .htaccess, or other mechanisms in the web server configuration.

1 Like

Also worth noting that https://example.com is really https://example.com/, due to HTTP requiring a non-empty “PATH”, so browsers always send a slash as the character for the root of the domain.

And, while not an issue here, you can’t match against a hash since the hash is not sent to the server at all. This is how encrypted file sharing services like mega and Firefox send prevent the server from knowing the encryption key.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.