Clean URL format


#1

Is it possible to implement an option to make all URL’s and links use a trailing slash at the end @Norm. Noticed after using the clean export my links get redirected for some strange reason (Nothing to do with Blocs or you)

example.com/reviews

to

example.com/reviews/

Small difference and unfortunately I can’t get my website to use the links without a trailing slash so wondered if this could be something easy to implement.

EDIT: I would change the links manually but I plan to edit them later on in the year and with over 200 links I don’'t fancy risk getting in a mess with it.

Thanks


#2

I think it is actually correct the way it is. When you go to example.com/reviews/ you are actually going to example.com/reviews/index.html and without that trailing slash it would break. If you check on the server, each folder should contain an index.html file.


#3

I agree, but the internal links using the interactions menu doesn’t contain the trailing slash (if you copy the link from a button it doesn’t contain a trailing slash) once the index.html has been removed, hence it gets redirected to the link with the trailing slash.

I only found out from using this: https://httpstatus.io


#4

If I try that it gives me a link like http://localhost:8080/photography.php


#5

This is the link Blocs automatically creates when I use the Interaction Menu ‘Navigate to Page = Services’: https://www.webdesign.co.uk/services

As you can see it’s redirected (not Blocs’ fault and technically it’s a good thing as google would see it as duplicate content)

The point I’m trying to make is I’m unable to force the URL without the trailing slash to be the canonical so my internal links created with Blocs are not redirects, but I’m unable to do so, and since Blocs doesn’t have a trailing slash at the end of it, every link clicked is basically a redirect that shouldn’t really be directed.


#6

I’ve just tried this myself on one of my Blocs sites and had the same result, but I think it’s essentially required if you are using clean urls. Just to double check this I tried a website I did with Rapidweaver and it gave exactly the same result. If you get rid of that trailing slash you are effectively blocking access to the folder that contains the page file. Luckily the browser takes care of it and goes to the right place.


#7

You definitely don’t have to use a trailing slash. If you must have one there’s a configuration issue in the .htaccess most likely. I’m not saying it’s messed up, but it could be improved if that’s what you want.

  • Google sees the two as separate urls.
  • Google also doesn’t prefer on over the other.
  • We use htaccess rewrite rules to make everything resolve to our chosen vanity URL.
  • This is how all of the major CMS’s do it. Sometimes they give you the option to keep or omit the trailing slash. Then they adjust the Htaccess accordingly.

It’s no different that using www or not. These are separate urls to Google. A rewrite is used to send all traffic to your preference.

The answer to why would you use a trailing slash is because it creates an empty url segment to target. Many CMS’s these url segments in the code in some cases trailing slash may be preferred but be mindful that you should make a redirect if you care about analytics.

I would probably never use the Blocs method for clean urls. I think it was a good move for sure, but one of the first things I did upon using blocs was write htaccess that fills all those needs and then some. It’s still the cleanest way to go. There are no subfolders needed and adding additional segments is trivial.


#8

It should be added that there is zero SEO impact nowadays for a 301 redirect, so Google effectively ignores the first. The problem with the .htaccess route is that Norm would have been dealing with support requests all day long and Blocs users would have become very stressed. There are just too many configurations out there and sooner or later things crash.

Before this was available in Blocs I tried half a dozen methods via .htaccess, but they all conflicted with the code I was using to ensure everything went to https.


#9

No problem. I just wanted to see if anyone else had this issue. My .htaccess is perfect and redirects to https and www with just the one redirect as it reads top to bottom. I’ve even deleted my whole .htaccess and it still made the redirect, which is not a bad thing.

It was just to try and avoid the unnecessary redirect that to me shouldn’t be there but it is, and its not just me but it seems its not all that important. I’ve improved my .htaccess since so redirects can be done in a single hit rather than 2-3 to get it to the right URL, saving requests and resources.


#10

It’s also worth remembering that redirect, occurs in a couple milliseconds and nobody will actually be aware of it, nor will you be penalised in any way. If you are creating backlinks you can always add the trailing / as well.

Something I want to sort out is HSTS and I posted a thread on this but nobody answered. HSTS SSL with Blocs


#11

The data is out there on htaccess. This is very doable. I disagree with the support premise. It’s being supported in basically every CMS I can think of. It’s time honored practically ancient. When there is an issue the solutions are pretty trivial in IMHO. Literally millions of Wordpress sites are doing this very thing… and Drupal and so many more.


#12

OK, but what about the endless configurations that users might create themselves? Some are using Cloudflare redirects, then others are running Litespeed cache .htaccess that can be super sticky. The list is endless and if the user is dealing with a page error or something doesn’t look right it won’t seem trivial, especially if they are new to all of this. Remember you have far greater experience in this than practically anybody else here.


#13

I understand where you’re coming from. I’ll make one more pass and drop it.

Millions use Wordpress with little or no programming knowledge and complex setups with only peer based support. That’s why I maintain it’s not that hard and why htaccess is so pervasive.
I find it strange that the level of comfort for someone with Cloudflare or Lightspeed or custom server setups wouldn’t be able to execute htaccess tweaks. and the core file could cover so many use cases like those mentioned and many more.

But hey, it’s not really a request since I don’t need the feature. Although it would be nice to edit the file in Blocs :wink:.


#14

I can only really speak for myself, but my ambition to gain an edge in different areas of work has often outstripped my technical ability and I’ve been breaking stuff consistently for 20+ years.

As for .htaccess, it’s not something I’ve ever specifically set out to learn, so I don’t have an in depth understanding, but I know enough to realise that two separate pieces of code can easily block access to a site if a conflict arises. In practice, I make regular use of .htaccess for various purposes, though the outcome is invariably a case of trial and error.