Resolved Problem with compressed XML sitemap

Discussion in 'Free Hosting' started by costas1, Apr 30, 2020.

Thread Status:
Not open for further replies.
  1. costas1

    costas1 Member

    Messages:
    96
    Likes Received:
    2
    Trophy Points:
    8

    I use the "\" in order to escape the ".": https://httpd.apache.org/docs/2.4/rewrite/intro.html#regex, otherwise the "." will just match any single character. The brackets are used for matching one character of a group of characters, so I guess "." and "[.]" are essentially identical.

    That's the version I used:

    Code:
    <FilesMatch "\.xml\.gz$">
        Header unset Content-Encoding
    </FilesMatch>
    


    That code appears to work with all the browsers I tried: Chrome, Edge, Firefox and Opera.

    The "RemoveOutputFilter" didn't seem to work for me. Isn't that way for you too? What happens if you try my version of code?
     
    Last edited: May 11, 2020
  2. garrettroyce

    garrettroyce Community Support Community Support

    Messages:
    5,345
    Likes Received:
    215
    Trophy Points:
    63
    [] means any character in the brackets and since . is the only character, only it can be matched. \. means only literal . can be matched. It's a preferential thing. I try to avoid escape character hell with things like /\/\ and "/"" because they're hard to read, but it's just my style. When you work with code where the escapes have to be escaped, it can be really ugly and you get things like quadruple backslashes. Brackets don't normally need to be escaped, so you avoid double escapes. Ironically, you could actually leave it just ".", but in the rare case you got something like "filexxmlxgz" it would actually match. I had it that way initially and then read that it uses regex and not glob, but it was technically working.

    Anyway, I tried so many things, I can't remember which did which. I also used a combination of curl and Vivaldi, so some things when they didn't work in one, I didn't try in the other, so possibly I missed some combination.

    The strange thing is curl works no matter what settings I had, and Vivaldi (basically open source Chromium) didn't work unless I did what I posted (apparently your shortened version as well). So what's the difference? Clearly it's not the server, because it sends the same headers and file data, so the browser is doing something weird. Setting the headers forces the browser to do things not weird, so I stand by my initial statement that it's a browser thing, and the fact that there's no setting to change this behavior makes it really annoying. It doesn't happen with any other file type, either, so it's definitely not consistent. But, every browser does it, so it's a standardized bug, except for curl? /rant

    The important thing is that it works. If you want to post here, or PM me the new link, I'll try it in Vivaldi and curl, but since curl always worked and Vivaldi is basically Chromium, I don't think I have anything new to contribute.
     
  3. costas1

    costas1 Member

    Messages:
    96
    Likes Received:
    2
    Trophy Points:
    8
    I also consider the issue resolved. There is no new link. I'm doing my testing with the same link I have sent you with a PM.
     
  4. garrettroyce

    garrettroyce Community Support Community Support

    Messages:
    5,345
    Likes Received:
    215
    Trophy Points:
    63
    I have no PM from you, but as long as you're happy, then everything is good.
     
  5. costas1

    costas1 Member

    Messages:
    96
    Likes Received:
    2
    Trophy Points:
    8
  6. garrettroyce

    garrettroyce Community Support Community Support

    Messages:
    5,345
    Likes Received:
    215
    Trophy Points:
    63
  7. costas1

    costas1 Member

    Messages:
    96
    Likes Received:
    2
    Trophy Points:
    8
    Well, thanks for the tests.
    I didn't share another file, because there would be no difference. They all have the same behavior.
     
  8. lylex10h

    lylex10h Active Member

    Messages:
    982
    Likes Received:
    70
    Trophy Points:
    28
  9. costas1

    costas1 Member

    Messages:
    96
    Likes Received:
    2
    Trophy Points:
    8
  10. garrettroyce

    garrettroyce Community Support Community Support

    Messages:
    5,345
    Likes Received:
    215
    Trophy Points:
    63
  11. costas1

    costas1 Member

    Messages:
    96
    Likes Received:
    2
    Trophy Points:
    8
    For me the backslash is more of a habit from other programming languages.
     
Thread Status:
Not open for further replies.

Share This Page