variable yang sangat membantu dalam membuat htaccess di webserver (apache or other).
HowTo
Server variables are accessible through %{VAR_NAME}. Some of the most useful ones are below:
HTTP_USER_AGENT | This is the client being used to access your server. You can use this to identify the browser being used and show different content accordingly. It also allows you to block certain unfriendly bots from your server. |
HTTP_REFERER | The referring page as sent by the browser. Note that this data is unreliable and can easily be modified by the user. You can use this variable to prevent hotlinking. |
HTTP_HOST | The current hostname. Possible values include domain.com, www.domain.com, sub.domain.com, an IP address or even your localhost. |
SERVER_PORT | The current port. This value is 80 for http, 443 for https (ssl). Useful for redirecting users to force them onto the secure connection. |
REMOTE_ADDR | The remote address of the user, also known as the IP. This allows you to block harmful bots or users. |
SCRIPT_FILENAME | The name of the requested file. This is the value that would be matched against the pattern of the RewriteRule. |
QUERY_STRING | This string contains all the GET data for the request. In other words, everything after the ? in the URL. For example, the QUERY_STRING variable for a request for file.php?foo=bar&pie=good will be \'foo=bar&pie=good\' |
REQUEST_URI | The requested URI, a combination of the SCRIPT_FILENAME followed by the QUERY_STRING if there is one. |
Post a Comment
Harap gunakan bahasa yang baik dan sopan, terima kasih