redirect trailing slash urls to non trailing slash urls

Redirect trailing slash urls to non trailing slash urls, a forum discussion on Jojo CMS. Join us for more discussions on Redirect trailing slash urls to non trailing slash urls on our Administration (backend and configuration) forum.

Back to Forum Index : Back to Administration (backend and configuration)   RSS
Dean

29 Sep 2008
Posts: 11

Hi

I've noticed that most jojo sites are set up with urls that look like this:
http://www.example.org/about/
but I would like to know if it's possible to set up a jojo site like this:
http://example.org/about
without the www and without the trailing slash at the end of the urls but have the trailing slash on the home page like so:
http://example.org/

Has anyone tried this before? Did it cause any problems?

Thanks
Dean
Harvey

Core Developer

Harvey

29 Sep 2008
Posts: 327

The framework is capable of handling this, but it will require a number of small core changes (which I wouldn't recommend attempting yourself). The original plan was to allow the user to choose the extension, between slash, no-slash, '.htm' or '.html' or anything else.

If this was important to you, I could probably implement this sooner rather than later - let me know if this is the case.

For the record, on the homepage it doesn't matter whether there is a trailing slash or not - the HTTP request is identical. However for other pages, they are considered to be 2 totally different URIs, and you need to choose one and use it consistently to avoid any duplicate content issues.

Jojo currently allows domains without the www - however I generally don't recommend this - see my blog post on www vs non-www.
Dean

21 Oct 2008
Posts: 11

Hi Harvey,

Yeah, if you were able to implement that feature so that authors could choose between a trailing slash and no trailing slash, that would be great. I don't think it's a good idea for people to use .htm or .html at the end of URLs though.

Cheers
Dean
BruceClement

Epsom, New Zealand

22 Oct 2008
Posts: 6

Can I put in a request for .html / etc to be supported please?

No, I don't think they are a good idea, except in special cases, but I've just moved a website from static html to Jojo (no re-design, just copy across the content as-is) for an associate & it would have been easier if I could have preserved the internal navigation / etc during a transitional phase.

Yes, I have built redirects, but even so...
Bruce Clement
Harvey

Core Developer

Harvey

23 Oct 2008
Posts: 327

Right on - if you can maintain the existing URL structure from the old site you are revamping, this saves a lot of hassle with redirects etc.

Implementing a user-defined suffix is on the list of things to do, and it will be able to support trailing slash / no trailing slash / .htm / .html / .php etc
BruceClement

Epsom, New Zealand

23 Oct 2008
Posts: 6

Thanks Harvey.
Bruce Clement
Dean

5 Mar 2011
Posts: 11

Hi Harvey. Have you had any more thoughts about implementing this feature into jojo? Perhaps you could tell me how to modify the code myself so I can get the non-trailing slash urls.
Dean
Back to Forum Index : Back to Administration (backend and configuration)   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.