In your .htaccess file you could try this below the RewriteEngine On
line
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R]
Taken from: https://stackoverflow.com/questions/21417263/htaccess-add-remove-trailing-slash-from-url
Related Posts:
- wp_sanitize_redirect strips out @ signs (even from parameters) — why?
- NextGEN Gallery Lightbox – Social Share URL Redirect
- WordPress redirects non-existing url to existing ones – how to disable
- My WP_options db rewrite_rules Does Not Work
- Can I change default registration link (without htaccess)?
- Redirect HTTP to HTTPS for all sub domains (blog posts)
- Rewrites: .htaccess or wp_rewrite for bulk 301 changes?
- WordPress rewrite front page url
- URL rewrite before template_redirect called
- Use Parent Pages for URL Structure without Landing Page
- Redirect if string found in URL
- How to make custom WordPress page deliver search results
- Rewrite Slug for CPT Archive Pages to Plural Name of Slug
- Change author base slug for different roles
- Problem with add_rewrite_rule and pagination (paged and page query_vars)
- Custom Permalinks for Blog Posts Only
- Detect page type by url (Archive, single, page, author,…)
- Using a page template without a page
- How to seamlessly redirect between different archive and singular slugs?
- Overwrite rewrite-slug of built in post-type ‘post’
- Why does wordpress still strip my query var?
- URL rewrites and pagination
- Rewrite rules goes away
- unexpected problem in url rewrite
- Need to make a php file inside theme accessible via url
- Remove child category from URL
- Rewrite loading custom template file but is_home() returns true, and there’s no 404
- Rewrite rule for admin-ajax.php
- Change WordPress comments url / word
- Cache issues with redis and nginx
- Rewrite WordPress Custom URL
- WordPress removes spaces in URL on pagination
- Adding more pages to author pages
- How to check current URL for endpoint in a template file?
- add_rewrite_rule not working for language specific characters
- Custom rewrite rule
- Add query string to url and display it as normal url part /folder/
- Is it possible to remove feeds from rewrites?
- Flush Rewrite Rules on init or rest_api_init?
- WordPress .htaccess – route other URLs to another app
- Rewrite URL – insert custom variables as a directory path
- URL endpoint with HTML
- Can’t add external rewrites
- Can I have /blog and /foo and /bar all point to the same blog?
- Monkey Man Rewrite Analyzer says my rule will trigger but it doesn’t [closed]
- Append a value to a certain page’s URL before page load
- How do I retain url parameters the entire time a user browses my site?
- Different URL rewrite rules loading the same page
- Cannot access wp-admin without trailing slash – .htaccess configuration for WordPress behind a nginx proxy
- Create Dynamic SEO Friendly URL for Virtual Page
- add_rewrite_rule with query variables
- WordPress author url to alias domain url? domain.com/author/{username}/
- Add language prefix to permalinks
- redirect post id to post full url
- Custom Rewrite rule to captured post (rewrite rule to rewrite rule)
- Attachment page gives 404 if user not logged
- How to change the Author Slug from Username to Nickname and deal with Special Characters
- How to pass url as a parameter in a add_rewrite_rule
- Per Page Permalink Structure for Page Post Type
- Customise particular RSS permalink
- RSS feed rewrite matching wrong rule
- Removing “www” from a site URL
- Replace “http://localhost:8888/” by website URL in WordPress
- Custom rewrite rule not working
- Thousands of 404 errors on old posts due to embedded links
- WP Rewrite for a custom variable
- Creating a folder structure
- How to Detect That WP is Using Mod Rewrite or $_GET variables?
- How do I get posts to appear at mydomain.com/blog?
- rewrite rules and capturing
- How to change search page url so that it still returns a page when there’s no search query specified?
- Custom taxonomy named ‘tag’ return 404 page
- Multiple permalink with and without category for same post
- Custom Params in URL
- Help adding custom url, rewrite_rules_array
- Implementing geotargeting while using a single database
- Url rewrite, add rule, redirect as POST request?
- Broken page redirect
- Add query arg for pretty permalinks in wordpress way
- Homepage cannot be found
- How to add 2 variable rewrite rule?
- Get custom posts by segment of the URL
- Remove trailing slash
- Rewrite Url to a SEO-friendly format
- add_rewrite Rule
- How to show my application as referral in WordPress Stats
- Fully mask *all* traces of WordPress installation subdirectory?
- Redirect A URL Pattern In WordPress Using .htaccess
- Help to cleanup this code
- Rewrite Question
- Change the search URL
- How to make a custom route with any-string-part/number-part pointing to an existing page?
- username in rewritten URL, howto use it in a template
- Rewwrite rule for mapping plugin static file
- Listing Authors – URL Formats [duplicate]
- wordpress url rewrite Query Var to Static url
- Add rewrite endpoint and .htaccess
- Remove url parameter using wordpress
- Change the slug ( url ) to a sequence number starting from 0 in the custom record type?
- Change url site.it/wordpress