It is rather a response on the client side.
Option 1:
What you can do is tell the browser to change the URL to something else you need (there may also be a nonexistent path). Please note: you cannot change your domain name.
So in your 1.php file add:
<script> window.history.pushState("{data: 'pass data'}", "PageTitle", "/url"); </script>
inside the head tag.
Option: 2
Another way I would recommend is using Ajax.
You can bind all of your <a href="/url"> so that when you click on it, it returns the data on this URL asynchronously without reloading the page.
So in the main index.php file add:
<li> <a href="http://cocvidarbha.epizy.com/">Page 1</a> </li> <li> <a href="http://cocvidarbha.epizy.com/voting/1.php">Page 2</a> </li> <div id="content"> Content will be loaded here without any page reload or URL change </div>
And then before </body> add:
// Include jQuery <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g=" crossorigin="anonymous"></script> <script> $(document).ready(function(e) { </script>
user3284463
source share