How to Remove Trailing Slash from URL in Nuxt + Netlify ?

featured Image

This article is about how to remove a trailing slash from URL in Nuxtjs hosted in Netlify.

If you have a site built with nuxt and hosted or deployed in Netlify, you have probably seen the trailing slash at the end of URL in each pages.

It is not an issue if you have define a trailing slash in all of your links by yourself.

But if you have not then the URL links without the trailing slash will be redirected to a URL will a slash at the end of it . It is automatically add by nuxt.

The redirect will cause a 301 redirect on the pages of your site, which is definitely not a good SEO practice. Your Google Search Console will give you a redirect error and those pages will not be crawled and indexed by google.

Remove trailing slash in Nuxt + Netlify

Since the site is deployed / hosted on Netlify, so the simple solution which I found on answer.netlify.com and have worked for me was to Disable Asset Optimization , but also make sure to explicitly check all the boxes except the “Pretty URLs

 Netlify + Nuxt - Remove trailing slash

IMPORTANT : Simple just checking the “Disable Asset Optimization” without checking the other check boxes, the redirect will still occur.

Once you have the changes as shown in the image above , the changes will take some time to propagate. And once it completed you will not longer be redirected.

Related Topics:

How To Run Netlify CMS Admin Locally?

Hide Admin Path On Deployment In NetlifyCMS.

Related Posts

git commands with example

Top 40 Git commands with Examples

GitHub has become an essential tool for developers to manage, store, and collaborate with other developers on software projects. With its simple powerful git-based version control system, GitHub allows users…

Read more
Check GitHub Account in the Terminal

Check GitHub Account in the Terminal

GitHub is an integral tool for developers to store, manage, and collaborate on software projects with other developers. And as we work more and more in the command line it…

Read more
featured Image

How to make list of objects in Netlify CMS using list and object Widget

Here in this Netlify CMS tutorial we will how easily we can make a list of objects using list and object widgets. This will allow us to add multiple objects…

Read more