Set up Redirection to a Wildcard Destination

#607764
  • Resolved Anonymous
    Rank Math free

    Hi Rank Math,

    We’ve just migrated our website from HubSpot to WordPress, and many of the images served in our emails (which were sent from HubSpot) are now showing as broken links.

    I would like to set up a 301 redirect on our new WordPress to direct images from our sent eDMs, to the new domain that images will be served under on the HubSpot site.

    e.g.
    Old image link (starts with) – https://edalex.com/hubfs/
    New image link (starts with) – https://comms.edalex.com/hubfs/

    Is there a way to do this automatically?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math support. We’re sorry to hear that you’re having trouble with broken image links after migrating your website from HubSpot to WordPress.

    We understand how frustrating it can be to see broken images in your emails. Fortunately, there is a way to set up a 301 redirect on your new WordPress site to direct images from your sent eDMs to the new domain that images will be served under on the HubSpot site.

    To set up a 301 redirect for your images from your old domain to your new domain, you can use the following .htaccess rule:

    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/hubfs/(.+)\.(png|gif|jpe?g|bmp)$ [NC]
    RewriteRule ^https://comms.edalex.com%{REQUEST_URI} [R=301,L]

    This rule will match any image request that starts with https://edalex.com/hubfs/ and redirect it to https://comms.edalex.com/hubfs/ with the same image name and extension. For example, https://edalex.com/hubfs/logo.png will be redirected to https://comms.edalex.com/hubfs/logo.png. You can add more file extensions to redirect more file types. You can add the rule by going to Rank Math > General Settings > Edit .htaccess.

    We hope this helps you resolve your issue. If you have any further questions or feedback, please feel free to contact us again.

    Thank you for using Rank Math! Have a great day!

    Anonymous
    Rank Math free

    Hi Great – thanks for the suggestion and we have updated the htaccess file accordingly – it doesn’t seem to be working, but we have devised a work around to deal with this. Thanks for trying!
    Kris

    Hello again,

    We are glad to hear that this issue has been resolved. Thank you for letting us know. This ticket will be closed now, but you can always open a new one if you have any other questions or concerns. We are here to help you with anything related to Rank Math.

    We appreciate your patience and cooperation throughout this process.

    Thank you for choosing Rank Math.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Set up Redirection to a Wildcard Destination’ is closed to new replies.