Skip to content Skip to sidebar Skip to footer

3 easy ways to redirect websites

Redirects

Redirect URL Of course, to get to another URL there are uses such as B. The session is not immediately thrown to another page, or it is very useful to shorten the URL. If you only need HTML or Javascript and PHP, we can redirect a page to another page.

There are 3 options and different components. HTML, Javascript and PHP have their own paths, but there are also differences between these paths.

Did you know already? When you log into a site, you are redirected to a new page. It can’t be called a redirect if we don’t see the action on the form first. If the URL is different, it means a redirect page is being used.

There are more than 3 available, but after 3 programming languages ​​I only shared 3 and know my way around programmers : Mr. Green:

(1.) Meta HTTP Equip Refresh [HTML]

This allows you to create a simple redirect page on an HTML site. And it is recommended to put it in the Head Tags section. Because according to HTML commands, Meta must be between the head tags. Actually, the code is not meant to be forwarded, it is meant to be auto-updated and a lot of people use it for forwarding, so a lot of people are using it! ️

(2.) Window position [Javascript]

<script>window.location="http://URLTujuan.com"</script>

The locations window has its own set of Javascript and page redirecting functions. You can paste the code between body tags and it will run automatically.

(3.) Header location [PHP]

PHP has several ways to redirect a page, but only the above method is commonly used by programmers. Use this feature like URL Shortening. And the weakness is that the location url can be read by the system so it can’t hide. Unlike Javascript and HTML above, the system cannot be read except for the source page.

Only 3 of the above methods I’ve used so far and mostly just Javascript and PHP as meta http equip is not efficient for forwarding in my opinion.

Does anyone want to ask for the code above ..? Please comment

Hopefully useful and good luck