404 errors for square.png

Home Forums Learning Forum Internet Learning Forum 404 errors for square.png

This topic contains 1 reply, has 2 voices, and was last updated by  Anna 2 years ago.

  • Author
    Posts
  • #3929

    GoutPal HelpDesk
    Participant
    Ŧallars: Ŧ 49.02



    When I check my Redirection 404 logs, I get lots of errors for square.png. It’s always at the end of a URL. i.e. /valid-page/square.png.

    I’ve searched Google for explanations, but I cannot find anything that explains why these requests are generated. There are hints that it might be something related to Apple browsers, but nothing conclusive. In the absence of anything else, I’d like to redirect these 404s to my favicon.

    I’m familiar with adding wildcards for URL endings using Redirection’s regex feature. I use a /partial-url(.*) and tick the regex box.

    Can anyone tell me the regex for square.png at the end of a URL?

  • #3934

    Anna
    Keymaster
    Ŧallars: Ŧ 47.85

    I googled “redirection regex” for more information about wildcard settings for the WordPress Redirection Plugin. Unfortunately, the official documentation has not been updated as the plugin has evolved. Therefore, it is a little confusing.

    The author writes:

    Regular expressions are a complicated subject and this page will not attempt to give more than a passing overview of using them. If you do need more help then you should take a look at a regular expression website.

    That’s fair enough for a free WordPress plugin. But, I feel a few well chosen, practical, examples will make the plugin easier to use. Let’s not get sidetracked on potential projects for improving Redirection.

    Just before my quoted section, we see “the (.*) a sequence of characters”. In your example, (.*) indicates any sequence of characters at the end of a URL. What you are really looking for is a regular expression (regex) for any sequence of characters at the beginning of a URL. So, you need (.*)square.png in your Redirection Source URL.
    Redirection starting wildcard screenshot

    I’ve tested this 404 redirect using the settings from the screenshot. It works, but might cause problems if you ever want to use an image on your website titled square.png.

You should Connect to Shrewdies to reply to this topic.


Simply click one of the buttons above to connect using your favourite network. Then, a box will appear here for you to post your reply.