A
A
antonovant2017-07-24 21:32:38
Web development
antonovant, 2017-07-24 21:32:38

/# appeared in the url addresses of the site, can this be removed?

There is a site on which, because of the widget on the pages, the page address changes, more precisely, mysite.ru /.../#... is added to the address like mysite.ru /.../ and so on each page with the widget. Tell me, can you remove it so that the address is not added or comment out all pages starting with # in the robots.txt file. I did this:
Dissalow: /#
Dissalow: /*/#
Dissalow: /*/*/#
I don't know if it works... And tell me how it affects seo

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Esin, 2017-07-24
@antonovant

These are anchors for references to document identifiers. A handy thing for navigating the page and for passing client parameters without cookies. They work exclusively on the client and do not get to the server. To remove them, you need to add something like this js:

$(window).on('hashchange', function() {
  window.location.hash = null;
});

This code will remove the anchor from the address bar whenever it is added. In some cases, this may break some plug-ins and effects that use anchors. To avoid this, you can modify the code and add a check only for an empty link:
$(window).on('hashchange', function() {
  if (window.location.hash == '#') {
    window.location.hash = null;
  }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question