Commit e9d1ab5b52

e9d1ab5b5229a8888f0cf8aacd65d1810d3c54cb

parent: 30bcea7a11

Unsigned

Sergey Briskin <sergey@briskin.org> · 2014-03-08 22:26 UTC

	Updated README.md: added .htaccess example
	new file:   htaccess

Layout: unified · split

README.md +24 −11
@@ -1,18 +1,31 @@
1ifconfig.php 1ifconfig.php
2============ 2============
3 3
4**Simple PHP script to show IP-address, UserAgent and other info** 4**Simple PHP script to show IP address, UserAgent and other info**
5 5
6It works exactly the same as [ifconfig.me](http://ifconfig.me) and [ifconfig.co](http://ifconfig.co).
6 7
7Added all basic features, such as output in HTML, plain text, XML and JSON. 8Available all basic features such as output in HTML, plain text, XML and JSON.
8By default it will be in HTML. Also it is possible to request single value. 9By default it will be in HTML. Also it is possible to request single values.
9 10
10Visit some of the links below to view it in action: 11Visit some of the links below to view it in action:
11* [all in plain text](http://briskin.org/ifconfig.php?q=text) 12* [all in plain text](http://briskin.org/ifconfig/text)
12* [all in xml](http://briskin.org/ifconfig.php?q=xml) 13* [all in xml](http://briskin.org/ifconfig/xml)
13* [useragent only](http://briskin.org/ifconfig.php?q=ua) 14* [ip address only](http://briskin.org/ifconfig/ip)
14 15* [useragent only](http://briskin.org/ifconfig/ua)
15P.s. 16
16I've made this script only as an illustration for my article about privacy problems. 17
17For now I have no plans to make it more powerfull, so I would like to recommend 18
18you another good project [ifconfig.co](http://ifconfig.co). 19This is example of .htaccess rules, to make this script more user friendly:
20
21 RewriteEngine On
22
23 RewriteCond %{REQUEST_FILENAME} !-d
24 RewriteCond %{REQUEST_FILENAME} !-f
25 RewriteRule ^ifconfig$ ifconfig.php [L]
26 RewriteRule ^ifconfig/(.*)$ /ifconfig.php?q=$1 [L]
27
28With this code in .htaccess file there is no need to type long line 'ifconfig.php?q='.
29Now just enough to open 'ifconfig/xml' to get XML output or 'ifconfig/ua' to determine useragent.
30
31Run `curl briskin.org/ifconfig/text` in Linux terminal to get some info.
htaccess added +6
@@ -0,0 +1,6 @@
1RewriteEngine On
2
3RewriteCond %{REQUEST_FILENAME} !-d
4RewriteCond %{REQUEST_FILENAME} !-f
5RewriteRule ^ifconfig$ ifconfig.php [L]
6RewriteRule ^ifconfig/(.*)$ /ifconfig.php?q=$1 [L]