URL exists only in history.pushState()

30 Views Asked by At

I'm using WP plugin Search and Filter + Dynamicoo for Elementor.

Search and Filter generated results using ajax and URL look like: "sitename.com/staff/?sft_brand1"

But this page does not index search robots. solved the problem like this:

(I'm sorry, I'll add the code tomorrow, just not at the computer)

// The page has been rendered
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    // generate meta tags
    // put meta in head
    window.history.pushState(some, '', 'new_location');
});

If I follow the new_location, I will come across a 404 error.

How to make a direct link to a new link to actually go to sitename.com/staff/?sft_brand1, at the same time save the new link and canonical?

This is my first question here. I'm sorry for my English)

0

There are 0 best solutions below