Force all urls to have trailing slash

#105219
  • Hye,

    Can anyone help me, I want to redirect all my URLs (except the homepage) to have a trailing slash at the end. My URLs are like this,

    https://example.com
    https://example.com/slug-1
    https://example.com/slug-2/
    https://example.com/slug-3?param=value
    https://example.com/slug-4#anchor-text

    I want to redirect all links to have a trailing slash after it, like these

    https://example.com (ignore homepage)
    https://example.com/slug-1<strong>/</strong>
    https://example.com/slug-2/
    https://example.com/slug-3<strong>/</strong>?param=value
    https://example.com/slug-4<strong>/</strong>#anchor-text

    Sorry, I can’t use .htaccess as I am using Nginx, neither I can use Nginx conf files, I want to redirect using RankMath Redirection Module.

    Thanks in advance.

Viewing 1 replies (of 1 total)
  • Michael Davis
    Rank Math pro

    Hello,

    Thank you for getting in touch with us.

    You can try the following:

    
    Source: /(.*)
    Target: https://example.com/$1/
    

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Force all urls to have trailing slash’ is closed to new replies.