Auto-generated student Dashboard links all broken - missing slash

Hi there, when I'm logged in as a Student, I have several links to click on in the Dashboard.

This is what the link LOOKS like (notice the ending):
http://my-art-related-website.comm/members/courses/course-nameworkbook/

(ps -- this is a FAKE LINK at the start -- I just wanted to show what it LOOKS LIKE)

This is what it SHOULD look like, with a SLASH before the word "workbook":
http://my-art-related-website.comm/members/courses/course-name/workbook/

This is the same for :
- units
- notifications
- discussion and
- workbook.

I've checked the site on both Firefox and Chrome on Mac, same result. Broken links.

>>> Is there a setting somewhere which needs a "trailing slash"?

I am spending so much time trying to get this site working, it's definitely not as simple as the sales page and instructions made it seem.

Many thanks in advance!

  • Webgirl42
    • WPMU DEV Initiate

    Hey Bojan, I have set up access for you, but I don't want to post my site's URL here.

    Let me know how to get that to you.

    PS -- I had the 'white screen of death' twice whilst installing your software plugins, so I have temporarily moved all other plugins into a different folder.

    Cheers and thanks in advance!

  • Bojan Radonic
    • Head of Support

    Hey there @Webgirl42,

    This is related to your permalink structure, CoursePress requires the use of "Post Name" in Settings -> Permalinks.

    You had permalinks set to custom structure with "/%postname%.html" which caused issue with the links. I've changed your permalink structure to post name and everything seems to be working fine now, see screenshot.

    Hope this helps :slight_smile:

    Cheers,
    Bojan

  • Webgirl42
    • WPMU DEV Initiate

    Hey Bojan, many thanks for solving the trailing slash, but I do have concerns over this -- and perhaps you can help solve them.

    My website has been online for several years with ".html" pages and blog posts -- now that you've changed the permalinks, all those links around the internet which "point" to my site will end up as 404 errors.

    Do you have a suggestion on how to make sure all the external links pointing into my site will continue to work?

    Many thanks in advance!

  • Bojan Radonic
    • Head of Support

    Hey again @Webgirl42,

    I've temporary reverted the changes until we figure out the issues related to links.

    I'm not really sure what you're referring to when you say "all those links around the internet which "point" to my site will end up as 404 errors."

    Can you please give me an example so I can better understand the issue.

    Best regards,
    Bojan

  • Webgirl42
    • WPMU DEV Initiate

    Hi Bojan,

    I have published videos and Press Releases on Youtube, Facebook and other websites with links to pages and posts like these:
    http://how-to-paint-on-silk.com/members/newsletter-sign-up.html
    http://how-to-paint-on-silk.com/members/august-news-2015-silk-tour-books-courses-oh-my.html

    These pages/links end with ".html" -- if we change the permalinks, and the ".html" is removed on the website, my guess is that when anyone clicks those links on --other-- websites, they will get a 404 error message.

    I would then assume that some kind of redirections would need to be put in place so that all ".html" page links will find the correct pages and posts on my site.

    Hope this makes sense
    Cheers

  • Bojan Radonic
    • Head of Support

    Hey again @Webgirl42,

    I've discussed this with one of our developers and he told me that this should be dealt with automatically when you change the permalink structure.

    In case that it doesn't we should be able to use redirection in .htaccess for that, this should redirect your .html links to their non .html version:

    RewriteCond %{THE_REQUEST} \.html
    RewriteRule ^(.*)\.html$ /$1 [R=301,L]

    Please add the above code to your .htaccess file in case the links are going to 404 after the change in permalink structure.

    Hope this helps :slight_smile:

    Cheers,
    Bojan

  • Webgirl42
    • WPMU DEV Initiate

    Hi Bojan,

    In my experience, changing the permalink in Wordpress would never automatically "redirect" a link with an .html extension to point to a non-html extension; it would require a 301 or other redirection to be implemented.

    1 -- I've now tested your theory by clicking on one of my links which appears in a press release on an external website, and I land on a 404 error page on my website.

    2 -- So next I added the code you provided to update the .htaccess file, but it hasn''t make a difference yet. Perhaps it's something which might take a few hours to work.

    3 -- As a short-term solution, I've now installed a plugin:

    -- https://wordpress.org/plugins/quick-pagepost-redirect-plugin/

    so I can redirect the links I know about, and as new 404 errors appear in my web statistics, I'll be able to add those external links into the plugin.

    4 -- This means the Student dashboard links will now work with the changed permalink, and some of the already-published links are also being redirected.

    Many thanks to you and the team for the efforts you've gone to in helping me solve these issues.
    cheers
    Teena

  • Webgirl42
    • WPMU DEV Initiate

    Hi Bojan,

    I have found the perfect solution for the '.html' permalinks being turned into 'non-html' links:

    In the htaccess file in the document root, add these BEFORE the wordpress rules:
    ----------------------
    RedirectMatch 301 ^/([^/]+)/([^/.]+)\.html$ /$1/$2/
    RedirectMatch 301 ^/([^/]+)/([^/]+)/([^/.]+)\.html$ /$1/$2/$3/
    ----------------------

    It's working perfectly now!

    cheers and thanks again,
    Teena

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.