1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Use PHP environment variables (REDIRECT_)
This guide explains how to use PHP environment variables with Web Hosting that runs on php-fpm.
PHP environment variables (REDIRECT_) are system variables used to store information about HTTP requests and redirects. They are typically used in web servers to store details about previous requests or redirects that have been performed. The "REDIRECT_" prefix is often added to environment variables to indicate that they are related to specific redirects performed by the server. These variables can contain information such as previous URLs, HTTP methods, or other data related to the client's navigation on the web server.
Using Environment Variables
Here's how to use PHP environment variables:
- Set PHP environment variables in a .htaccess file:
SetEnv EXAMPLEVARIABLE hello
- In your PHP file, the variable name to call should be prefixed with REDIRECT_:
In this example, the displayed result will be hello.