1. Open rewrite
sudo a2enmod rewrite
2. Deactivate rewrite
sudo a2dismod rewrite
3. Server environment variables
The environment variable that Apache provides to the Rewirte module is probably divided into 5 types.
Part I: HTTP headers partial parameters
Parameter name: http_user_agent
Sample reference value: mozilla/5.0 (Windows; U Windows NT 5.1; ZH-CN; rv:1.9.0.8) gecko/2009032609 firefox/3.0.8
Description: Equivalent to PHP server parameters: $_server["Http_user_agent"]
Parameter name: Http_referer
Sample reference value: http://www.test.cn/test.php
Description: Equivalent to PHP server parameters: _server["Http_referer"]
Parameter name: Http_cookie
Sample reference value: ZDEDEBUGGERPRESENT=PHP,PHTML,PHP3
Description: Equivalent to PHP server parameters: $_server["Http_cookie"]
Parameter name: http_forwarded
Sample reference value: If the use of Proxy server will be the IP address of the proxy server, local environment is not easy to test the value.
Description: Equivalent to PHP server parameters: $_server["http_forwarded"]
Parameter name: Http_host
Sample reference value: www.test.com
Description: Equivalent to PHP server parameters: $_server["Http_host"]
Parameter name: http_proxy_connection
Sample reference value: Information about the network connection agent. The same as the http_forwarded parameter. It is not easy to test the value of the environment locally.
Description: PHP does not seem to provide such a server information value. If again, it may be equivalent to: $_server["Http_proxy_connection"]
Parameter name: http_accept
Sample reference value: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Description: Equivalent to PHP server parameters: $_server["Http_accept"]
Part II: Server Internals Partial parameters
Parameter name: Document_root
Sample reference value: c:/webroot/t
Description: Equivalent to PHP server parameters: $_server["Document_root"]
Parameter name: server_admin
Sample reference value: youemailaddress@gmail.com
Description: Equivalent to PHP server parameters: $_server["Server_admin"]
Parameter name: server_name
Sample reference value: www.test.com
Description: Equivalent to PHP server parameters: $_server["SERVER_NAME"]
Parameter name: SERVER_ADDR
Sample reference value: 127.0.0.1
Description: Equivalent to PHP server parameters: $_server["SERVER_ADDR"]
Parameter name: Server_port
Sample reference value: 80
Description: Equivalent to PHP server parameters: $_server["Server_port"]
Parameter name: Server_protocol
Sample reference value: http/1.1
Description: Equivalent to PHP server parameters: $_server["Server_protocol"]