Skip to main content

Command Palette

Search for a command to run...

Hashnode Page Rules - Say goodbye to long and boring URLs πŸ‘‹

Create custom URLs with the Hashnode custom page rules

Updated
β€’2 min read
Hashnode Page Rules - Say goodbye to long and boring URLs πŸ‘‹

Sometimes, links can become long and cumbersome. They look ugly, untrustworthy and spammy, which makes them difficult to share online.

However, Hashnode comes to the rescue. Hashnode has a feature, called custom page rules, that allows you to create a custom URL that redirects to another URL.

Thus, you can use your domain to create nice-looking, shorter URLs.

Custom Page Rules

With the Hashnode custom page rules, you can create shorter URLs using your domain. Thus, instead of having one long URL, you can create a shorter URL with the following structure - your_domain.com/yourPath.

Let's take as an example this YouTube link - https://www.youtube.com/channel/UCl1IRCSmm74qhcFNPTHcbMg, which represents my YouTube channel. I wanted to create something shorter and easier to remember.

As a result, I used the custom page rules to shorten the URL. Now, the URL to my YouTube channel is https://catalins.tech/youtube. Besides shortening the URL, it also makes it more intuitive.

Don't you agree that the URL looks better?

How does it work?

When you create a redirect URL, you only need to provide the path. Hashnode automatically appends the path you provide to your domain (as long as it's not taken already).

For instance, if your domain is blogger.com, and you want to add the path /youtube, you only need to specify the path, and Hashnode appends it automatically to the domain.

After that, you need to select the redirect type you want. For example, you can choose a 301 or a 302 redirect type.

Lastly, you need to add the destination URL, which is the URL where your custom page rule will redirect people. After pressing the "Add rule" button, blogger.com/youtube will redirect to your YouTube channel.

Figure 1 below illustrates the process of creating a custom page rule. Thus, you can create your customized URLs within minutes.

Screenshot 2021-07-07 at 11.20.50.png

Figure 1

For more information about the custom page rules, I recommend checking the Hashnode documentation.

Conclusion

And that's how you set custom page rules! Did you know about them, or did you use them?

This feature is handy, and it allows you to create links that are:

  • easy to remember
  • looking more professional
C
CapsCode4y ago

Amazing...thanks for this article

W
Wei Lun4y ago

What is the difference between 301 and 302 redirection type

1
C

Yong Wei Lun "A 301 redirect means that the page has permanently moved to a new location. A 302 redirect means that the move is only temporary."

Source

2
W
Wei Lun4y ago

Catalin Pit I know the definition, in the case of redirection mention in the post, should we use 301 or 302?

K

Yong Wei Lun 302 tells search engine not to index it, 301 otherwise. So, basically if you won't be changing your page - like here Catalin Pit YT channel - you would use 301.

I'm using 302 redirections to always link to the latest post (https://blog.cyberethical.me/latest)

1
W
Wei Lun4y ago

Kamil Gierach-Pacanek I see thanks. How to you make the latest link? Mind to share?

1
K

Yong Wei Lun Sure:

image.png

As you can see, I've entered the latest 302 redirection to the newest article. I have to update it manually - but this is the only place I'm changing it. I have the latest link on my Instagram and other social media.

1
W
Wei Lun4y ago

Kamil Gierach-Pacanek Oh i thought can be update automatically

1

New Features and Highlights ✨

Part 16 of 26

A series about Hashnode's new features releases and updates. We ship things faster and listen to the dev community at Hashnode. Request a new feature [here](https://hashnode.com/feature-requests).

Up next

Hashnode Share Draft Feature - Write Better Articles

Improve the quality of your articles with peer feedback

More from this blog

T

Town Hall - The official Hashnode blog

208 posts

Welcome to the official Hashnode blog. Find our product updates, announcements, interviews, and more here. Get started with Hashnode now.