trailing slashes

#423595
  • Resolved Alireza Naji
    Rank Math free

    hi, thanks for your great plugin and support

    how can i do redirect with rank math for this:

    url with trailing slashes to none trailing slashes

    sample:

    https://sample.com/content/
    to
    https://sample.com/content

    this is htaccess code:

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !\.(gif|jpg|png|jpeg|css|js)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{HTTP_HOST} !^\.localhost$ [NC]
    RewriteRule ^(.+[^/])/$ http://%{HTTP_HOST}/$1 [R=301,L]

    thank you and thanks for your time

Viewing 3 replies - 1 through 3 (of 3 total)
  • Nigel
    Rank Math business

    Hello,

    Thank you for contacting Rank Math for help with setting the trailing slash URL structure.

    Keeping the trailing slash in usually the best practice. WordPress is also set to automatically redirect to the trailing slash version by default. Rank Math cannot do trailing slash redirects. The best method is to rely on is to use an .htaccess file like the one you shared.

    Hope that helps. Please let us know if you have questions.

    thanks Nigel

    Hello,

    We are super happy that we could address your concern.

    If you have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

You must be logged in to reply to this ticket.