WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Trailing slash at the at the end of URL (2 posts)

  1. tazogamer
    Member
    Posted 2 years ago #

    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 "/"

  2. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    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!)

Topic Closed

This topic has been closed to new replies.

About this Topic