0

Help me please, I have this url: https://abc.def/dany%20rina and the name on my web page is "dany rina" when I change to https://abc.def/robert%20chealsea it will also change automatically the name from "dany rina" to "robert chealsea".

My question: In what kind of topic I can find this case? Or is there any css code that solves the problem?

Thank you!

Gibberish
  • 98
  • 12
  • The url doesn't work... – Gibberish Apr 03 '21 at 14:31
  • Could you describe what the problem actually is? Do you mean the names are in the webpage or is it in the address bar of the browser that you don't want the names to change? I assume your URL was just an example rather than a real site? – A Haworth Apr 03 '21 at 15:30
  • The topic you are getting into is URL parsing with JavaScript. CSS does not apply here. This is an example of what you are trying to get at https://stackoverflow.com/questions/736513/how-do-i-parse-a-url-into-hostname-and-path-in-javascript – cmorr Apr 03 '21 at 15:36
  • 1. Yeah..it's just an example. i mean when i type with different name in the address bar of the browser, the name on the page of my website also change like what i type in the address bar. 2. Ok tq so much. i'll check it. – Andi Widodo Apr 03 '21 at 20:54

1 Answers1

0

You want to a achieve the redirection to another page. There are plenty of ways to implement that

The very basic way is to handle with your hosting provider - In the domain settings you can set a specified redirection

The other way is to handle URLs on the backend side. For simple example(express.js):

if (myUrl==="/x-y-z") {
   res.redirect("/xyz")
}
Iwaniukooo
  • 26
  • 4