How To Make A Transition To A Page On The Site

Table of contents:

How To Make A Transition To A Page On The Site
How To Make A Transition To A Page On The Site

Video: How To Make A Transition To A Page On The Site

Video: How To Make A Transition To A Page On The Site
Video: Build Amazing Page Transitions In Only 12 Minutes 2024, May
Anonim

To organize on your site the automatic redirection of all visitors to one specific page of your own or someone else's Internet resource, you can use several different methods. For example, you can insert appropriate HTML, JavaScript, or PHP commands into each page. But this will require reworking all pages of the site. There is an easier option - to place the corresponding directive in the htaccess file in the root directory of the site.

How to make a transition to a page on the site
How to make a transition to a page on the site

Instructions

Step 1

The Apache web server, having found such a file in the folder requested by the browser of the page visitor, must execute the directives written in it, and then continue processing the visitor's request. Your task for redirecting will be to create such a file, place the necessary directives in it and upload it to your site's server. The first step in this plan is simple - open any text editor (like Notepad) and create a new document.

Step 2

The second step is to select the directive that best suits your task. If you need to redirect absolutely all web surfers requesting absolutely any page on your site to a specific page, then you should put the following command in htaccess: Redirect / redirect. Slash without specifying a folder name on the server means that the redirect refers to documents in all folders, starting from the root. And the path to a folder on your server, then only visitors requesting documents from the specified folder will be sent to the specified address. Such a directive can be written, for example, as follows: Redirect special / forU / folder special. Only web surfers requesting documents of a certain type can be sent to the specified page. Such a directive may look like this: RedirectMatch (. *). Html $ https://kakprosto.ru This means that visitors to pages with the html extension will be sent by the server to the specified address, and those who come to pages with the htm extension will view them in the usual way.

Step 3

After choosing the appropriate redirect option and specifying the addresses, save the.htaccess file. Note that the file has no name, only an extension. It remains to implement the third part of the plan - upload htaccess to the server of your site. You can do this using your hosting provider's file manager or content management system. Or you can use any FTP client.

Recommended: