Articles on: FAQs

How to force trailing slash in URLs?

If you want to force trailing slash in your URLs, add the following code to your .htaccess file:

Make sure to add this code above FlyingPress rules in htaccess.

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Force trailing slash
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1/ [L,R=301]

Updated on: 22/12/2023

Was this article helpful?

Share your feedback


Thank you!