Change website url using php or javascript?

I want to change the URL of my site .. I want to create a new URL from www.mysite.com/username that will be displayed in the address bar .. even if you click on any link or button on my site, then it will be displayed on one site-wide site .. ex ..

http://www.willmaster.com/library/web-development/URL-masking.php then it should be displayed http://www.willmaster.com/username in the URL and work as described above ...

+2
source share
4 answers

This will not be done by PHP or Javascript.

Run via mod rewrite in the .htaccess file. See the links for more information:

http://edrackham.com/apache/beginners-mod_rewrite-tutorial/

+4
source

what you are looking for is called: .

Look around ( here )

+1
source

Rewriting / redirecting URLs will not allow two or more different pages to be displayed at the same URL. Use a full-screen frame to mask the URL.

+1
source

make sure your URL that accesses the first page is the URL you want to always display.

using javascript, processes all clicks and receives data only through ajax.

0
source

Source: https://habr.com/ru/post/895223/


All Articles