Support » Fixing WordPress » Trailing slash at the at the end of URL

  • Resolved tazogamer

    (@tazogamer)


    How to remove trailing slash from the end of the PAGE url:
    site.com/about-us/ -> site.com/about-us

    in earlier versions it was set with permalinks, but in wp3.31 it doesn’t work anymore and redirects to a page with “/”

Viewing 1 replies (of 1 total)
  • Pioneer Web Design

    (@swansonphotos)

    If this is due to hard coding the links, use a 301 redirect rule in your .htaccess file such as, for example:

    # customrule
    rewriteengine on
    rewritecond %{HTTP_HOST} ^yoursite.com$
    rewriterule ^about-us(.*)$ "http\:\/\/yoursite\.com\/about-us$1" [R=301,L]
    # end customrule

    These rules must be at top of .htaccess before any WordPress or caching rewrite rules and supported by your server/host.

    Or fix the hyperlinks…

    But first check the rewrite rules in your .htaccess file as there are likely some there already doing the reverse of above (backup current file first!)

Viewing 1 replies (of 1 total)
  • The topic ‘Trailing slash at the at the end of URL’ is closed to new replies.