S
S
Sergei_SS2020-05-13 15:44:42
WordPress
Sergei_SS, 2020-05-13 15:44:42

Is it possible to redirect from an anchor to another link on the same page?

Good afternoon!

Tell me please.

I work on WordPress. I pull a specific module to the site using JS.
There are several stages in this module, each of which changes the address in the line:

The page itself - Site/page
1 stage of the module - Site/page/#/
2 stage of the module - Site/page/#/abc
And so on, there are many stages.

Is there an option to make an auto-redirect from the 1st stage to the second?

Normal type redirects via .htaccess don't help, I read that data from anchors is not processed on the server or something like that)

Maybe there is some kind of JS that will allow you to redirect in this way?)

Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergei_SS, 2020-05-14
@Sergei_SS

It seems there was an option:
script type="text/javascript">
if (document.location.href != " https://site/page/# "){
document.location.href = " https://site/page/ #/abc ";
}
/script
Well, the word script at the end in brackets <> of course, and at the beginning the first character is also < yet, the system does not allow writing)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question