1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

why i can redirect links that end with Slash

Discussion in 'BlackHat Lounge' started by CeaseFireBlack, Jun 20, 2016.

  1. CeaseFireBlack

    CeaseFireBlack Regular Member

    Joined:
    Jun 10, 2015
    Messages:
    421
    Likes Received:
    151
    i literally can't redirect links that end with Slash /
    i tried multiple plugins.
    for exemple:
    -i can redirect this: mysite.com/post1
    -and i cant redirect this: mysite.com/post1/

    i want to redirect second link, coz when someone navigates in my site and clicks on post, the link of the post always ends with a Slash.

    this is a serious issue for me, i wasted my whole day trying to figuring it out.
     
  2. Zwielicht

    Zwielicht Moderator Staff Member Moderator Jr. VIP

    Joined:
    Aug 31, 2013
    Messages:
    6,629
    Likes Received:
    11,764
    Gender:
    Male
    Occupation:
    Private Investigator
    Location:
    Riverside, California
    Home Page:
    I've never come across that issue before. Have you tried redirecting the link through your hosting control panel?

    You can also try removing the trailing slashes at the end of your URLs by going to your permalinks settings.
     
    • Thanks Thanks x 1
  3. CeaseFireBlack

    CeaseFireBlack Regular Member

    Joined:
    Jun 10, 2015
    Messages:
    421
    Likes Received:
    151
    i'll be doing that for every post i'll be making, i talked to my hosting support, they told me if i do it through cpanel it will slow my site and its not recommended.
    where can i see the permalinks settings.for exemple if u even check posts in BHW, they all end up with Slash.
     
  4. Zwielicht

    Zwielicht Moderator Staff Member Moderator Jr. VIP

    Joined:
    Aug 31, 2013
    Messages:
    6,629
    Likes Received:
    11,764
    Gender:
    Male
    Occupation:
    Private Investigator
    Location:
    Riverside, California
    Home Page:
    For your posts, all you need to do is go to Settings>Permalinks>Custom Structure and set the custom structure to /%postname%. That'll remove the trailing slash on your posts.

    For the rest of your site, I think you would need to go through the code to remove trailing slashes.
     
  5. CeaseFireBlack

    CeaseFireBlack Regular Member

    Joined:
    Jun 10, 2015
    Messages:
    421
    Likes Received:
    151
    i managed to remove the Slash, i want to redirect to same link for exemple: mysite.com/post1 => mysite.com/post1/playlist
    but same old error keep appearing
     
    Last edited: Jun 20, 2016
  6. Zwielicht

    Zwielicht Moderator Staff Member Moderator Jr. VIP

    Joined:
    Aug 31, 2013
    Messages:
    6,629
    Likes Received:
    11,764
    Gender:
    Male
    Occupation:
    Private Investigator
    Location:
    Riverside, California
    Home Page:
    What do you mean? Shouldn't you be able to just 301 redirect that link?