Fast Links

Free SEO Audit

Crawl the website for technical issues and get a prioritized to-do list with detailed guides on how to fix.

Sitechecker crozdesk rating Sitechecker crowd rating Sitechecker capterra rating
Sitechecker trusted company

What does empty href for html tag mean and how to build relative link URLs correctly

What does empty href for html <base> tag mean and how to build relative link URLs correctly

If the Base URL malformed or empty error occurs, it means that you indicated an invalid or empty URL marked by the HTML tag, which defines the path of relative links on the site.

What Does «Empty Href For HTML Tag» Means?

Webmasters use relative links to simplify navigation to internal site URLs. To implement this feature, they use the HTML tag. It defines a base URL, which is used to set relative URLs that lead to content and other links on the site. In addition, the base element can be used to set the target window for all links on the current page.

The href attribute of the tag is used to set the URL of the document used for navigation. The attribute indicates a link that uses any protocol the browser supports.

For example, https://site.com/ uses the resources/images folder to store images. This URL can be specified in the href attribute value of the tag:

<base href=”resources/images”>

You don’t have to repeat the entire URL every time you access the images to which the links lead. After specifying the folder URL in the base tag, the relative URL to the image looks like this:

<p><img src=”picture-1.jpg”/></p>

The full path to the image will be http://site.com/resources/images/picture-1.jpg, and the browser will be able to find the requested file regardless of the location of the web page.

You can set the tag on a page by default. In this case, it will apply not only to images and hyperlinks but also to forms, scripts, and styles.
<h2id=”ik_Trigger” >What triggers this issue?

The situation occurs if there is an error in the base tag. It may be caused by incorrect formatting of the base URL, by a syntax or grammar error, or if the base link URL is not listed at all.

How to check the issue?

The href attribute of the tag should contain the URL without errors.

URL example:

<base href=”https://site.com/resources/images”>

When you use it to link to the document picture-1.jpg you can just type

<img src=”images/picture-1.jpg”>

Examples of an incorrect base tag

The path to the document folder is not specified:

<base href = “”>

An invalid protocol is specified in the base URL:

<base href = “htps://site.com”>

The base URL contains spaces:

<base href = “htps://site. com”>

For browser compatibility, check out the guide for developers: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base.

Find out not only the information about Base URL being malformed or empty, but also the presence of technical errors on it!

Conduct a full audit to find out and fix all the site level and page level issues on your website.

Sitechecker rating on crozdesk Sitechecker rating on crowd Sitechecker rating on capterra

Why is this important?

Web owners use the base tag to reduce the size of the page, optimize markup by using shorter URLs, and simplify relative URL redirection and migration in general. However, the improperly formatted base tag can result in broken links and prevent search engines from crawling relative links on the site. This negatively affects the ranking of pages and the resource in general.

How to fix the issue?

Put the href attribute before other elements with URL attribute values in the head section. The base tag defines the URLs of all the links that follow. All base elements with the href attribute following it will be ignored.

Identify the cause of the problem and make changes to the base tag. The tag should not contain errors, such as invalid protocol, spaces, uppercase characters.

The use of the base tag is justified in rare cases; in most situations, it is recommended to avoid using it.

Check Your Website for SEO Errors

Go to App
Something went wrong. Please, try again later.
close