For my WordPress website, I use the plugin ‘Wp domain checker’. You can check if a domain is available and proceed with a redirect. The problem is that I want it to redirect to a special redirect depending on the page where the domain checker is embedded in. For example, if it is embeded in: test.com/page1 and the redirect would be test.com/succes I want it to redirect to test.com/succes-test.com/page1

With the plugin that I am using, you can add {domain} at the end to redirect to a special URL with the chosen domain at the end. I want this functionality, but then with the current URL instead of the chosen domain. I know that this works via an input text field, with the name=”domain”

Do I need to do this with PHP, or can I use the following JavaScript function, and how?:

document.write(window.location.href)

And do I need to insert the code into the plugin PHP code, or in the current WordPress page?

Read more here: Redirect with current domain at the end – WordPress plugin


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: