WordPress.org

Forums

Remove trailing slash on certain pages (2 posts)

  1. Mat Gargano
    Member
    Posted 5 years ago #

    Hi:

    I am putting together a page that I want to rewrite page "player" with a $_GET (plid) to /player/plid.html

    i.e.

    http://mypage/player/abcdefg.html rewrite http://mypage/index.php?pagename=player&plid=abcdefg

    this works great, except it adds a trailing slash to the page, so when I enter in:

    http://mypage/player/abcdefg.html

    the page loads fine, but it adds a / like this:

    http://mypage/player/abcdefg.html/

    how can i prevent this?

    below is my htaccess with the rewrite code that I added.

    thanks!

    mat

    RewriteEngine On
    RewriteRule ^player/([^/]*)/$ /index.php?pagename=player&plid=$1 [L]
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    </IfModule>
    
    # END WordPress
  2. Mat Gargano
    Member
    Posted 5 years ago #

    Anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.