Search code examples
.htaccesshttp-redirecttrailing-slash

Htaccess - redirecting trailing slash to no-slash URL


I need to redirect trailing slash exact URL ( www.xyz.com/registration/ ) to non-slash ( www.xyz.com/registration ) with httaccess. But only this exact URL, not any other. How to do it?


Solution

  • If you want to do a 301 redirect to a specific URL:

    RedirectMatch 301 ^/registration/$ /registration