diff options
author | Sergey Briskin <sergey@briskin.org> | 2014-03-09 02:26:54 +0400 |
---|---|---|
committer | Sergey Briskin <sergey@briskin.org> | 2014-03-09 02:26:54 +0400 |
commit | e9d1ab5b5229a8888f0cf8aacd65d1810d3c54cb (patch) | |
tree | 7f95bfc370659848581ce87af77cadb2e2752500 | |
parent | 30bcea7a11d23accff7e5c06f598c98942c89655 (diff) | |
download | ifconfig.php-e9d1ab5b5229a8888f0cf8aacd65d1810d3c54cb.tar.gz ifconfig.php-e9d1ab5b5229a8888f0cf8aacd65d1810d3c54cb.tar.bz2 ifconfig.php-e9d1ab5b5229a8888f0cf8aacd65d1810d3c54cb.zip |
Updated README.md: added .htaccess example
new file: htaccess
-rw-r--r-- | README.md | 35 | ||||
-rw-r--r-- | htaccess | 6 |
2 files changed, 30 insertions, 11 deletions
@@ -1,18 +1,31 @@ ifconfig.php ============ -**Simple PHP script to show IP-address, UserAgent and other info** +**Simple PHP script to show IP address, UserAgent and other info** +It works exactly the same as [ifconfig.me](http://ifconfig.me) and [ifconfig.co](http://ifconfig.co). -Added all basic features, such as output in HTML, plain text, XML and JSON. -By default it will be in HTML. Also it is possible to request single value. +Available all basic features such as output in HTML, plain text, XML and JSON. +By default it will be in HTML. Also it is possible to request single values. Visit some of the links below to view it in action: -* [all in plain text](http://briskin.org/ifconfig.php?q=text) -* [all in xml](http://briskin.org/ifconfig.php?q=xml) -* [useragent only](http://briskin.org/ifconfig.php?q=ua) - -P.s. -I've made this script only as an illustration for my article about privacy problems. -For now I have no plans to make it more powerfull, so I would like to recommend -you another good project [ifconfig.co](http://ifconfig.co). +* [all in plain text](http://briskin.org/ifconfig/text) +* [all in xml](http://briskin.org/ifconfig/xml) +* [ip address only](http://briskin.org/ifconfig/ip) +* [useragent only](http://briskin.org/ifconfig/ua) + + + +This is example of .htaccess rules, to make this script more user friendly: + + RewriteEngine On + + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ifconfig$ ifconfig.php [L] + RewriteRule ^ifconfig/(.*)$ /ifconfig.php?q=$1 [L] + +With this code in .htaccess file there is no need to type long line 'ifconfig.php?q='. +Now just enough to open 'ifconfig/xml' to get XML output or 'ifconfig/ua' to determine useragent. + +Run `curl briskin.org/ifconfig/text` in Linux terminal to get some info. diff --git a/htaccess b/htaccess new file mode 100644 index 0000000..ccd64f4 --- /dev/null +++ b/htaccess @@ -0,0 +1,6 @@ +RewriteEngine On + +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^ifconfig$ ifconfig.php [L] +RewriteRule ^ifconfig/(.*)$ /ifconfig.php?q=$1 [L] |