<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>php genious &#187; HTACCESS</title>
	<atom:link href="http://www.phpgenious.com/category/htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpgenious.com</link>
	<description></description>
	<lastBuildDate>Tue, 27 Sep 2011 21:02:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>URL Rewriting in Opencart</title>
		<link>http://www.phpgenious.com/2010/07/url-rewriting-in-opencart/</link>
		<comments>http://www.phpgenious.com/2010/07/url-rewriting-in-opencart/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 17:33:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTACCESS]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Opencart HTACCESS]]></category>
		<category><![CDATA[URL rewriting in opencart]]></category>

		<guid isPermaLink="false">http://www.phpgenious.com/?p=430</guid>
		<description><![CDATA[Hello Friends !! Today I am going to introduce that how to enable URL rewriting in Opencart. I have completed my two projects in opencart and I already faced the [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Friends !! Today I am going to introduce that how to enable URL rewriting in Opencart.</p>
<p>I have completed my two projects in opencart and I already faced the problem that how to enable URL rewriting in Opencart.</p>
<p>So today I want to share with all of you guys that how to use URL rewriting in Opencart.<span id="more-430"></span></p>
<p>Follow below steps :</p>
<p>1) Rename your htaccess.txt to .htaccess.<br />
2) Enter in admin area.<br />
3) Go to <strong>Admin-&gt;Configuration-&gt;Settings-&gt;Server</strong> and check <strong>SEO URL</strong> option Yes.<br />
4) Then you have to enter SEO keyword field in every products/categories/information etc.<br />
5) You can find this field at that time of insertion or edition.</p>
<p>After all this settings, I am sure that URL rewriting is working in your opencart site.</p>
<p>If you have further query or if you have any confusion, then feel free to comment me. I will try my best to solve your issues..</p>
<p>Thanks in advance !!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpgenious.com/2010/07/url-rewriting-in-opencart/feed/</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
		<item>
		<title>URL Rewriting with PHP and IIS 7</title>
		<link>http://www.phpgenious.com/2010/04/url-rewriting-with-php-and-iis-7/</link>
		<comments>http://www.phpgenious.com/2010/04/url-rewriting-with-php-and-iis-7/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 07:31:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTACCESS]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[SEO friendly URL]]></category>
		<category><![CDATA[URL Rewriting]]></category>
		<category><![CDATA[Web.config]]></category>

		<guid isPermaLink="false">http://www.phpgenious.com/?p=382</guid>
		<description><![CDATA[Hello friends !! Few days ago, I faced a URL rewriting problem on windows server. After checking the server configuration, I found that there is an II7 installed. After long [...]]]></description>
			<content:encoded><![CDATA[<p>Hello friends !! Few days ago, I faced a URL rewriting problem on windows server. After checking the server configuration, I found that there is an <strong>II7 </strong>installed. After long research about this, I found that <strong>II7 </strong>is not support <strong>.HTACCESS. </strong>If youwant to male your site SEO URL friendly, then you have to use <strong>web.config</strong> file for URL rewriting instead of <strong>.HTACCESS</strong>. Now the question is how to make <strong>web.config </strong>file from <strong>.HTACCESS </strong>?</p>
<p>IIS 7 uses a file called Web.config to hold settings for integration  with applications. The Web.config file contains information that control  module loading, security configuration, session state configuration,  and application language and compilation settings. Web.config files can  also contain application-specific items such as database connection  strings.<br />
Today in this post, I will explain you how to make it ? This post contains most common uses of the .htaccess file by PHP applications, and shows  how to use the Web.config file for these same functions in <strong>IIS</strong>.<br />
Now First Here are the sample files of <strong>.HTACCESS</strong> and <strong>Web.config.</strong><br />
<span id="more-382"></span></p>
<h4>.HTACCESS Sample code</h4>
<div class="code">
<p>#<br />
# Apache/PHP/Application settings:<br />
#</p>
<p># Protect files and directories from prying eyes.</p>
<p>Order allow,deny</p>
<p># Don&#8217;t show directory listings for URLs which map to a directory.<br />
Options -Indexes</p>
<p># Follow symbolic links in this directory.<br />
Options +FollowSymLinks</p>
<p># Make Application handle any 404 errors.<br />
ErrorDocument 404 /index.php</p>
<p># Force simple error message for requests for non-existent favicon.ico.</p>
<p>ErrorDocument 404 &#8220;The requested file favicon.ico was not found.</p>
<p># Set the default handler.<br />
DirectoryIndex index.php</p>
<p># Override PHP settings. More in sites/default/settings.php<br />
# but the following cannot be changed at runtime.</p>
<p># PHP 4, Apache 1.</p>
<p>php_value magic_quotes_gpc                0<br />
php_value register_globals                0<br />
php_value session.auto_start              0<br />
php_value mbstring.http_input             pass<br />
php_value mbstring.http_output            pass<br />
php_value mbstring.encoding_translation   0</p>
<p># PHP 4, Apache 2.</p>
<p>php_value magic_quotes_gpc                0<br />
php_value register_globals                0<br />
php_value session.auto_start              0<br />
php_value mbstring.http_input             pass<br />
php_value mbstring.http_output            pass<br />
php_value mbstring.encoding_translation   0</p>
<p># PHP 5, Apache 1 and 2.</p>
<p>php_value magic_quotes_gpc                0<br />
php_value register_globals                0<br />
php_value session.auto_start              0<br />
php_value mbstring.http_input             pass<br />
php_value mbstring.http_output            pass<br />
php_value mbstring.encoding_translation   0</p>
<p># Requires mod_expires to be enabled.</p>
<p># Enable expirations.<br />
ExpiresActive On</p>
<p># Cache all files for 2 weeks after access (A).<br />
ExpiresDefault A1209600</p>
<p># Do not cache dynamically generated pages.<br />
ExpiresByType text/html A1</p>
<p># Various rewrite rules.</p>
<p>RewriteEngine on</p>
<p># If your site can be accessed both with and without the &#8216;www.&#8217; prefix, you<br />
# can use one of the following settings to redirect users to your preferred<br />
# URL, either WITH or WITHOUT the &#8216;www.&#8217; prefix. Choose ONLY one option:<br />
#<br />
# To redirect all users to access the site WITH the &#8216;www.&#8217; prefix,<br />
# (http://example.com/&#8230; will be redirected to http://www.example.com/&#8230;)<br />
# adapt and uncomment the following:<br />
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]<br />
# RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]<br />
#<br />
# To redirect all users to access the site WITHOUT the &#8216;www.&#8217; prefix,<br />
# (http://www.example.com/&#8230; will be redirected to http://example.com/&#8230;)<br />
# uncomment and adapt the following:<br />
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]<br />
# RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]</p>
<p># Modify the RewriteBase if you are using Application in a subdirectory or in a<br />
# VirtualDocumentRoot and the rewrite rules are not working properly.<br />
# For example if your site is at http://example.com/application uncomment and<br />
# modify the following line:<br />
# RewriteBase /application<br />
#<br />
# If your site is running in a VirtualDocumentRoot at http://example.com/,<br />
# uncomment the following line:<br />
# RewriteBase /</p>
<p># Rewrite URLs of the form &#8216;x&#8217; to the form &#8216;index.php?q=x&#8217;.<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteCond %{REQUEST_URI} !=/favicon.ico<br />
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]</p>
<p># $Id: .htaccess,v 1.90.2.1 2008/07/08 09:33:14 goba Exp $</p>
</div>
<h4>Web.config Sample Code</h4>
<div class="code">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;configuration&gt;</p>
<p>&lt;configSections&gt;<br />
&lt;sectionGroup name=&#8221;system.webServer&#8221;&gt;<br />
&lt;sectionGroup name=&#8221;rewrite&#8221;&gt;<br />
&lt;section  name=&#8221;rewriteMaps&#8221; overrideModeDefault=&#8221;Allow&#8221; /&gt;<br />
&lt;section  name=&#8221;rules&#8221; overrideModeDefault=&#8221;Allow&#8221; /&gt;<br />
&lt;/sectionGroup&gt;<br />
&lt;/sectionGroup&gt;<br />
&lt;/configSections&gt;</p>
<p>&lt;system.webServer&gt;<br />
&lt;security&gt;<br />
&lt;!&#8211;  This section should be uncommented after<br />
installation to secure the installation. &#8211;&gt;<br />
&lt;!&#8211;<br />
&lt;requestFiltering&gt;<br />
&lt;denyUrlSequences&gt;<br />
&lt;add sequence=&#8221;engine&#8221; /&gt;<br />
&lt;add  sequence=&#8221;inc&#8221; /&gt;<br />
&lt;add sequence=&#8221;info&#8221;  /&gt;<br />
&lt;add sequence=&#8221;module&#8221; /&gt;<br />
&lt;add sequence=&#8221;profile&#8221; /&gt;<br />
&lt;add  sequence=&#8221;po&#8221; /&gt;<br />
&lt;add sequence=&#8221;sh&#8221; /&gt;<br />
&lt;add sequence=&#8221;theme&#8221; /&gt;<br />
&lt;add  sequence=&#8221;tpl(\.php&#8221; /&gt;<br />
&lt;add  sequence=&#8221;Root&#8221; /&gt;<br />
&lt;add sequence=&#8221;Tag&#8221;  /&gt;<br />
&lt;add sequence=&#8221;Template&#8221; /&gt;<br />
&lt;add sequence=&#8221;Repository&#8221; /&gt;<br />
&lt;add  sequence=&#8221;code-style&#8221; /&gt;<br />
&lt;/denyUrlSequences&gt;<br />
&lt;fileExtensions&gt;<br />
&lt;add  fileExtension=&#8221;.sql&#8221; allowed=&#8221;false&#8221; /&gt;<br />
&lt;add fileExtension=&#8221;.pl&#8221; allowed=&#8221;false&#8221; /&gt;<br />
&lt;/fileExtensions&gt;<br />
&lt;/requestFiltering&gt;<br />
&#8211;&gt;<br />
&lt;/security&gt;<br />
&lt;directoryBrowse  enabled=&#8221;true&#8221; /&gt;<br />
&lt;caching&gt;<br />
&lt;profiles&gt;<br />
&lt;add extension=&#8221;.php&#8221;  policy=&#8221;DisableCache&#8221; kernelCachePolicy=&#8221;DisableCache&#8221; /&gt;<br />
&lt;add extension=&#8221;.html&#8221; policy=&#8221;CacheForTimePeriod&#8221;  kernelCachePolicy=&#8221;CacheForTimePeriod&#8221; duration=&#8221;14:00:00:00&#8243; /&gt;<br />
&lt;/profiles&gt;<br />
&lt;/caching&gt;<br />
&lt;rewrite&gt;<br />
&lt;rules&gt;<br />
&lt;rule  name=&#8221;block favicon&#8221; stopProcessing=&#8221;true&#8221;&gt;<br />
&lt;match url=&#8221;favicon\.ico&#8221; /&gt;<br />
&lt;action type=&#8221;CustomResponse&#8221; statusCode=&#8221;404&#8243; subStatusCode=&#8221;1&#8243;<br />
statusReason=&#8221;The requested file favicon.ico was not found&#8221;<br />
statusDescription=&#8221;The requested file favicon.ico was not found&#8221; /&gt;<br />
&lt;/rule&gt;<br />
&lt;rule name=&#8221;Imported Rule 1&#8243;  stopProcessing=&#8221;true&#8221;&gt;<br />
&lt;match url=&#8221;^(.*)$&#8221;  ignoreCase=&#8221;false&#8221; /&gt;<br />
&lt;conditions&gt;<br />
&lt;add input=&#8221;{HTTP_HOST}&#8221; pattern=&#8221;^example\.com$&#8221; /&gt;<br />
&lt;/conditions&gt;</p>
<p>&lt;action type=&#8221;Redirect&#8221; redirectType=&#8221;Permanent&#8221;  url=&#8221;http://www.example.com/{R:1}&#8221; /&gt;<br />
&lt;/rule&gt;<br />
&lt;rule name=&#8221;Imported Rule 2&#8243;  stopProcessing=&#8221;true&#8221;&gt;<br />
&lt;match url=&#8221;^(.*)$&#8221;  ignoreCase=&#8221;false&#8221; /&gt;<br />
&lt;conditions&gt;<br />
&lt;add input=&#8221;{REQUEST_FILENAME}&#8221; matchType=&#8221;IsFile&#8221;  ignoreCase=&#8221;false&#8221; negate=&#8221;true&#8221; /&gt;<br />
&lt;add input=&#8221;{REQUEST_FILENAME}&#8221; matchType=&#8221;IsDirectory&#8221;  ignoreCase=&#8221;false&#8221; negate=&#8221;true&#8221; /&gt;<br />
&lt;add input=&#8221;{URL}&#8221; pattern=&#8221;^/favicon.ico$&#8221; ignoreCase=&#8221;false&#8221;  negate=&#8221;true&#8221; /&gt;<br />
&lt;/conditions&gt;<br />
&lt;action type=&#8221;Rewrite&#8221; url=&#8221;index.php?q={R:1}&#8221;  appendQueryString=&#8221;true&#8221; /&gt;<br />
&lt;/rule&gt;<br />
&lt;/rules&gt;<br />
&lt;/rewrite&gt;<br />
&lt;defaultDocument&gt;<br />
&lt;files&gt;<br />
&lt;remove value=&#8221;index.php&#8221; /&gt;<br />
&lt;add  value=&#8221;index.php&#8221; /&gt;<br />
&lt;/files&gt;<br />
&lt;/defaultDocument&gt;</p>
<p>&lt;!&#8211; HTTP Errors section  should only be enabled if the &#8220;Error Pages&#8221;<br />
feature has been  delegated as &#8220;Read/Write&#8221; at the Web Server level.<br />
&lt;httpErrors&gt;<br />
&lt;remove statusCode=&#8221;404&#8243;  subStatusCode=&#8221;-1&#8243; /&gt;<br />
&lt;error statusCode=&#8221;404&#8243;  prefixLanguageFilePath=&#8221;" path=&#8221;/index.php&#8221; responseMode=&#8221;ExecuteURL&#8221;  /&gt;<br />
&lt;/httpErrors&gt;<br />
&#8211;&gt;</p>
<p>&lt;/system.webServer&gt;<br />
&lt;/configuration&gt;</p>
</div>
<h4>Default Document</h4>
<p>In the .htaccess file for the sample application, the <em>DirectoryIndex</em> directive tells the Web server which file to load if no filename is  included with the URL.</p>
<div class="code"><samp># Set the default handler.<br />
DirectoryIndex  index.php</samp></div>
<p>For IIS 7, the default document should be set up as high in the Web  site hierarchy as the Module Handler. For example, with PHP, the Module  Handler is usually set at the Web server level. The default document  should be set at that level also, rather than locally within a Web  site’s context. The following code within your Web.config file can  ensure this:</p>
<div class="code"><samp> &lt;defaultDocument&gt;<br />
&lt;files&gt;<br />
&lt;remove value=&#8221;index.php&#8221; /&gt;<br />
&lt;add value=&#8221;index.php&#8221; /&gt;<br />
&lt;/files&gt;<br />
&lt;/defaultDocument&gt;</samp><samp></samp></p>
</div>
<h4>Error Page Redirects / Handling using .HTACCESS and Web.config</h4>
<p>Some applications handle standard errors within the scope of the   application. The <em>ErrorDocument</em> directive in the .htaccess file of   the sample application tells the Web server to load the home page for   any 404 or “File Not Found” errors.</p>
<div class="code">
<p># Make Application handle   any 404 errors.</p>
<p>ErrorDocument 404 /index.php</p>
</div>
<p>IIS uses the <em>httpErrors</em> directive for this functionality.   However, because the capability to set this at the application level is   turned off by default for IIS, this section should be commented out.</p>
<div class="code">
<p>&lt;!&#8211;   HTTP Errors section should only be enabled if the &#8220;Error Pages&#8221;</p>
<p>feature   has been delegated as &#8220;Read/Write&#8221; at the Web Server level.</p>
<p>&lt;httpErrors&gt;</p>
<p>&lt;remove statusCode=&#8221;404&#8243;   subStatusCode=&#8221;-1&#8243; /&gt;</p>
<p>&lt;error statusCode=&#8221;404&#8243;   prefixLanguageFilePath=&#8221;" path=&#8221;/index.php&#8221; responseMode=&#8221;ExecuteURL&#8221;   /&gt;</p>
<p>&lt;/httpErrors&gt;</p>
<p>&#8211;&gt;</p>
</div>
<h4>URL Rewriting using .HTACCESS and Web.config</h4>
<p>IIS 7 includes the URL Rewrite module. You can use this extension to   provide rules for IIS to rewrite incoming URL requests. The most common   use of URL Rewriting is to provide shorter, easy-to-remember URLs.</p>
<p>Many PHP applications currently ship with rewrite rules as part of   their .htaccess file. These rules tell Apache’s mod_rewrite how and when   to rewrite incoming requests. The IIS 7 URL Rewrite module can read   these rules and translate them into URL Rewrite rules.</p>
<p>For the sample application codes, the relevant mod_rewrite rules in the   .htaccess file are:</p>
<div class="code">
<p>RewriteCond %{HTTP_HOST} ^example\.com$   [NC]</p>
<p>RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]</p>
<p>RewriteCond %{REQUEST_FILENAME} !-f</p>
<p>RewriteCond   %{REQUEST_FILENAME} !-d</p>
<p>RewriteCond %{REQUEST_URI} !=/favicon.ico</p>
<p>RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]</p>
</div>
<p>The IIS URL Rewriter module can read these rules and translate them.   The translated URL Rewriter rules are:</p>
<div class="code">
<p>&lt;rewrite&gt;</p>
<p>&lt;rules&gt;</p>
<p>&lt;rule name=&#8221;Imported Rule 1&#8243;   stopProcessing=&#8221;true&#8221;&gt;</p>
<p>&lt;match url=&#8221;^(.*)$&#8221;   ignoreCase=&#8221;false&#8221; /&gt;</p>
<p>&lt;conditions&gt;</p>
<p>&lt;add   input=&#8221;{HTTP_HOST}&#8221; pattern=&#8221;^example\.com$&#8221; /&gt;</p>
<p>&lt;/conditions&gt;</p>
<p>&lt;action type=&#8221;Redirect&#8221;   redirectType=&#8221;Permanent&#8221; url=&#8221;http://www.example.com/{R:1}&#8221; /&gt;</p>
<p>&lt;/rule&gt;</p>
<p>&lt;rule name=&#8221;Imported Rule 2&#8243;   stopProcessing=&#8221;true&#8221;&gt;</p>
<p>&lt;match url=&#8221;^(.*)$&#8221;   ignoreCase=&#8221;false&#8221; /&gt;</p>
<p>&lt;conditions&gt;</p>
<p>&lt;add   input=&#8221;{REQUEST_FILENAME}&#8221; matchType=&#8221;IsFile&#8221; ignoreCase=&#8221;false&#8221;   negate=&#8221;true&#8221; /&gt;</p>
<p>&lt;add input=&#8221;{REQUEST_FILENAME}&#8221;   matchType=&#8221;IsDirectory&#8221; ignoreCase=&#8221;false&#8221; negate=&#8221;true&#8221; /&gt;</p>
<p>&lt;add input=&#8221;{URL}&#8221; pattern=&#8221;^/favicon.ico$&#8221; ignoreCase=&#8221;false&#8221;   negate=&#8221;true&#8221; /&gt;</p>
<p>&lt;/conditions&gt;</p>
<p>&lt;action   type=&#8221;Rewrite&#8221; url=&#8221;index.php?q={R:1}&#8221; appendQueryString=&#8221;true&#8221; /&gt;</p>
<p>&lt;/rule&gt;</p>
<p>&lt;/rules&gt;</p>
<p>&lt;/rewrite&gt;</p>
</div>
<p>I think this post become very helpful to those peoples who wants to use URL rewriting (SEO friendly URL) in IIS whcih are using PHP.</p>
<p>Feel free to post comment on this post. Thanks You &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpgenious.com/2010/04/url-rewriting-with-php-and-iis-7/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>CGI Tutorial</title>
		<link>http://www.phpgenious.com/2010/03/cgi-tutorial/</link>
		<comments>http://www.phpgenious.com/2010/03/cgi-tutorial/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 06:48:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTACCESS]]></category>
		<category><![CDATA[CGI]]></category>
		<category><![CDATA[CGI Variavles]]></category>
		<category><![CDATA[fastCGI]]></category>
		<category><![CDATA[URL Rewriting]]></category>

		<guid isPermaLink="false">http://www.phpgenious.com/?p=368</guid>
		<description><![CDATA[CGI stands for Common Gateway Interface, which is the standard for creating dynamic files or web pages. It can be seen in use on thousands of web pages &#8211; website [...]]]></description>
			<content:encoded><![CDATA[<p>CGI stands for Common Gateway Interface, which is the standard for creating dynamic files or web pages. It can be seen in use on thousands of web pages &#8211; website guest books which allow a visitor to enter a message which is displayed the next time anyone accesses the guest page, or search engine pages where one types in a query and the search engine responds by displaying the results pages.</p>
<p>CGI scripting actually refers to writing a program that will control how a website&#8217;s content can be displayed to visitors.</p>
<p><span id="more-368"></span></p>
<h2>CGI variables</h2>
<p>Before running a CGI application or interpreter, Abyss Web Server   sets its environment variables in conformity with the CGI/1.1   specification and adds variables declared in the <strong>Custom   Environment Variables</strong> table as well as the system environment   variables. Some Abyss Web Server specific variables are also set.</p>
<p>The following list contains the variables documented in the CGI/1.1 specification and some variables commonly set by web servers:</p>
<ul>
<li>PATH_INFO: The extra path information, as given in the requested URL. In fact, scripts can be accessed by their   virtual path, followed by extra information at the end of this path.   The extra information is sent in PATH_INFO.</li>
<li>PATH_TRANSLATED: The virtual-to-real   mapped version of PATH_INFO.</li>
<li>SCRIPT_NAME: The virtual path of the   script being executed.</li>
<li>SCRIPT_FILENAME and REQUEST_FILENAME: The real path of the script   being executed.</li>
<li>SCRIPT_URI: The full URL to the current   object requested by the client.</li>
<li>URL: The full URI of the current   request. It is made of the concatenation of SCRIPT_NAME   and PATH_INFO (if available.)</li>
<li>SCRIPT_URL and REQUEST_URI:   The original request URI sent by the client.</li>
<li>REQUEST_METHOD: The method used by the   current request; usually set to GET or POST.</li>
<li>QUERY_STRING: The information which   follows the ? character in the requested   URL.</li>
<li>CONTENT_TYPE: The MIME type of the   request body; set only for POST or PUT requests.</li>
<li>CONTENT_LENGTH: The length in bytes of   the request body; set only for POST or PUT requests.</li>
<li>AUTH_TYPE: The authentication type if   the client has authenticated itself to access the script.</li>
<li>AUTH_USER and REMOTE_USER:   The name of the user as issued by the client when authenticating itself   to access the script.</li>
<li>ALL_HTTP: All HTTP headers sent by the   client. Headers are separated by carriage return characters (ASCII 13 &#8211; \n) and each header name is prefixed by HTTP_, transformed to upper cases, and &#8211; characters it contains are replaced by _ characters.</li>
<li>ALL_RAW: All HTTP headers as sent by the   client in raw form. No transformation on the header names is applied.</li>
<li>SERVER_SOFTWARE: The web server&#8217;s   software identity.</li>
<li>SERVER_NAME: The host name or the IP   address of the computer running the web server as given in the requested   URL.</li>
<li>SERVER_PORT: The port to which the   request was sent.</li>
<li>GATEWAY_INTERFACE: The CGI Specification   version supported by the web server; always set to CGI/1.1.</li>
<li>SERVER_PROTOCOL: The HTTP protocol   version used by the current request.</li>
<li>REMOTE_ADDR: The IP address of the   computer that sent the request.</li>
<li>REMOTE_PORT: The port from which the   request was sent.</li>
<li>DOCUMENT_ROOT: The absolute path of the   web site files. It has the same value as <strong>Documents   Path</strong>.</li>
<li>INSTANCE_ID: The numerical identifier of   the host which served the request. On Abyss Web Server X1, it is always   set to 1 since there is only a single host.</li>
<li>APPL_MD_PATH: The virtual path of the   deepest alias which contains the request URI. If no alias contains the   request URI, the variable is set to /.</li>
<li>APPL_PHYSICAL_PATH: The real path of the   deepest alias which contains the request URI. If no alias contains the   request URI, the variable is set to the same value as DOCUMENT_ROOT.</li>
<li>IS_SUBREQ: It is set to true if the current request is a subrequest,   i.e. a request not directly invoked by a client. Otherwise, it is set to   true. Subrequests are generated by the   server for internal processing. XSSI includes for example result in   subrequests.</li>
</ul>
<p>If the current request is served by an SSL enabled host, the   following SSL related variables are also available:</p>
<ul>
<li>SSL_PROTOCOL: The SSL protocol version.   It could be SSLv2, SSLv3,   or TLSv1.</li>
<li>SSL_CIPHER and HTTPS_CIPHER:   The SSL protocol version. It could be SSLv2,   SSLv3, or TLSv1.</li>
<li>SSL_CIPHER_EXPORT: It is set to true if the cipher is conforming to US export   restrictions (i.e. it is limited to 56 bit symmetric keys and 1024   asymmetric keys).</li>
<li>SSL_CIPHER_USEKEYSIZE and HTTPS_SECRETKEYSIZE: The number of cipher bits   currently used.</li>
<li>SSL_CIPHER_ALGKEYSIZE and HTTPS_KEYSIZE: The maximum number of cipher bits   that could be used.</li>
<li>SSL_SERVER_M_VERSION: The version of the   server&#8217;s certificate.</li>
<li>SSL_SERVER_M_SERIAL: The serial number   of the server&#8217;s certificate.</li>
<li>SSL_SERVER_V_START: The date   corresponding to the start of the validity the server&#8217;s certificate.</li>
<li>SSL_SERVER_V_END: The date corresponding   to the end of the validity the server&#8217;s certificate.</li>
<li>SSL_SERVER_A_SIG: The algorithm used to   sign the server&#8217;s certificate.</li>
<li>SSL_SERVER_A_KEY: The encryption type of   the private key of the server&#8217;s certificate.</li>
<li>SSL_SERVER_S_DN and HTTPS_SERVER_SUBJECT: The value of the subject&#8217;s   DN (distinguished name) of the server&#8217;s certificate.</li>
<li>SSL_SERVER_S_DN_<em>component</em>: The value of the <em>component</em> of the   subject&#8217;s DN (distinguished name) of the server&#8217;s certificate. <em>component</em> can be CN (Common Name), C   (Country), ST or SP   (State/Province), L (Locality), O (Organization), OU   (Organization Unit), T (Title), I (Initials), G   (Given Name), S (Surname), D (Description), Email   (Contact Email).</li>
<li>SSL_SERVER_I_DN and HTTPS_SERVER_ISSUER: The value of the issuer&#8217;s   DN (distinguished name) of the server&#8217;s certificate.</li>
<li>SSL_SERVER_I_DN_<em>component</em>: The value of the <em>component</em> of the   issuer&#8217;s DN (distinguished name) of the server&#8217;s certificate.</li>
</ul>
<p>The Abyss Web Server specific variables provide a means to access to   server and host statistics. They are listed below:</p>
<ul>
<li>X_ABYSS_STATS_SERVER_UPTIME: The total   time in seconds during which the server was up.</li>
<li>X_ABYSS_STATS_SERVER_CURRENT_UPTIME: The   total time in seconds during which the server was up since the last   start or restart.</li>
<li>X_ABYSS_STATS_SERVER_TOTAL: The total   number of processed requests for all the hosts. It includes also bad   requests that were not targeting a specific host and that resulted in an   error.</li>
<li>X_ABYSS_STATS_SERVER_ERROR: The number   of requests for which the server replied by an error.</li>
<li>X_ABYSS_STATS_SERVER_HTML: The number of   requests the server replied to by a document which MIME type was text/html.</li>
<li>X_ABYSS_STATS_SERVER_IMAGE: The number   of requests the server replied to by a document which MIME type starts   with image/.</li>
<li>X_ABYSS_STATS_SERVER_NOTMODIFIED: The   number of requests for which the server detected that the requested   document has not changed.</li>
<li>X_ABYSS_STATS_SERVER_OUTPUT: The total   size in bytes of the payload sent by the server to the clients.</li>
<li>X_ABYSS_STATS_SERVER_COMPRESS_TOTAL: The   total number of compressed responses for all the hosts.</li>
<li>X_ABYSS_STATS_SERVER_COMPRESS_OUTPUT_TOTAL:   The total size in bytes of the payload sent by the server to the   clients in compressed responses.</li>
<li>X_ABYSS_STATS_SERVER_COMPRESS_ORIGINAL_OUTPUT:   The total original uncompressed size in bytes of the payload sent by   the server to the clients in compressed responses.</li>
<li>X_ABYSS_STATS_HOST_UPTIME: The total   time in seconds during which the current host was up.</li>
<li>X_ABYSS_STATS_HOST_CURRENT_UPTIME: The   time in seconds during which the current host was up since the last   server start or restart.</li>
<li>X_ABYSS_STATS_HOST_TOTAL: The total   number of requests processed by the current host.</li>
<li>X_ABYSS_STATS_HOST_ERROR: The number of   requests targeting the current host that resulted in an error.</li>
<li>X_ABYSS_STATS_HOST_HTML: The number of   requests the current host replied to by a document which MIME type was text/html.</li>
<li>X_ABYSS_STATS_HOST_IMAGE: The number of   requests the current host replied to by a document which MIME type   starts with image/.</li>
<li>X_ABYSS_STATS_HOST_NOTMODIFIED: The   number of requests for which the current host detected that the   requested document has not changed.</li>
<li>X_ABYSS_STATS_HOST_OUTPUT: The total   size in bytes of the payload sent by the current host to the clients.</li>
<li>X_ABYSS_STATS_HOST_COMPRESS_TOTAL: The   total number of compressed responses for the current host.</li>
<li>X_ABYSS_STATS_HOST_COMPRESS_OUTPUT_TOTAL:   The total size in bytes of the payload sent by the current host to the   clients in compressed responses.</li>
<li>X_ABYSS_STATS_HOST_COMPRESS_ORIGINAL_OUTPUT:   The total original uncompressed size in bytes of the payload sent by   the current host to the clients in compressed responses.</li>
</ul>
<p>In addition to these variables, all header lines received in the   request are added to the environment with the prefix HTTP_ followed by the header name in upper   cases. All &#8211; characters in the header name   are changed to underscore _ characters. For   example, User-Agent is translated to HTTP_USER_AGENT.</p>
<p>If the request results from an internal redirection (from an XSSI   document or if it is used as a custom error page for example), the   environment variables of the parent request are also added and each   variable name is prefixed by REDIRECT_. The   parent request&#8217;s status code is stored in the special variables REDIRECT_STATUS and REDIRECT_STATUS_CODE.   The cookies of the parent request are also passed to the redirected   request in the COOKIES environment   variable. REDIRECT_STATUS_CODE may seem   redundant but it is actually useful when with PHP scripts as some PHP   configurations require setting REDIRECT_STATUS   to a fixed value.</p>
<p>If you have any suggestion or any confusion, feel free to post comments.</p>
<p>Thanks a mill !!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpgenious.com/2010/03/cgi-tutorial/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>Redirect to https (SSL) in php</title>
		<link>http://www.phpgenious.com/2009/03/redirect-to-https-ssl-in-php/</link>
		<comments>http://www.phpgenious.com/2009/03/redirect-to-https-ssl-in-php/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 09:21:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTACCESS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[.HTACCESS Tips]]></category>

		<guid isPermaLink="false">http://www.phpgenious.com/?p=284</guid>
		<description><![CDATA[Hello Friends !! Today I found some new things. This post is show you how to redirect to https(SSL) in PHP. First, What is SSL ? Let me Explained : [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Friends !!</p>
<p>Today I found some new things. This post is show you how to redirect to https(SSL) in PHP.</p>
<p>First, What is SSL ? Let me Explained :</p>
<p>SSL meand Secure Socket Layer. It is developed by Netscape to transmit private data via Internet.</p>
<p>SSL uses a cryptographic system that uses two keys to encrypt data &#8211; a public key known to everyone and a private or secret key known only to the recipient of the message. Both Netscape Navigator and Internet Explorer support SSL, and many Web sites use the protocol to obtain confidential user information, such as credit card numbers. By convention, URLs that require an SSL connection start with https: instead of http:</p>
<p>Most of e-commerce sites uses payment gateway for online payment.And those sites use SSL connection to transfer data to and from the payment gateway.</p>
<p>Most of the sites use http protocol. But in above case wehave to redirect browser to https.<br />
If you want to see example, write &#8220;http://www.gmail.com&#8221; in browser, it automatically redirects to https.It means site transfer to SSL protocol.</p>
<p>First of all, you should know that SSL must be installed in the server. To redirect the browser to &#8220;https&#8221; , we must know that the site is using SSL or not at the moment. And for this, there is a server variable in PHP called &#8220;HTTPS&#8221;. $_SERVER['HTTPS'] returns &#8220;on&#8221; values when the site is using SSL connection.<br />
<span id="more-284"></span><br />
<!--adsense#DeleteJQueryRecords--><br />
PHP function to redirect browser to &#8220;https&#8221;</p>
<div class="code">&lt;?<br />
function redirectTohttps()<br />
{<br />
if($_SERVER['HTTPS']!=&#8221;on&#8221;)<br />
{<br />
$redirect= &#8220;https://&#8221;.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];<br />
header(&#8220;Location:$redirect&#8221;);<br />
}<br />
}<br />
?&gt;</div>
<p>you can call the function in that page where you have to redirect the browser to &#8220;https&#8221;.</p>
<p>Redirect website to &#8220;https&#8221; using .HTACCESS</p>
<p>You have to call above function in each and every page if you want to redirect whole sote. But rather than doing so it will be better to write code in .htaccess file to redirect the whole website to use SSL connection throughout the pages.Here is the .htaccess code :</p>
<div class="code">RewriteEngine On<br />
RewriteCond %{HTTPS} !on<br />
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}</div>
<p>Just copy this code in yuor .htaccess file and place it in your root directory. Whole site will be redirected to &#8220;https&#8221; when browser will open with &#8220;http&#8221;.</p>
<p>If you have any query or any question then please comment on this post.</p>
<p>Thanks in Advance&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpgenious.com/2009/03/redirect-to-https-ssl-in-php/feed/</wfw:commentRss>
		<slash:comments>82</slash:comments>
		</item>
		<item>
		<title>Block Proxy Servers using .htaccess</title>
		<link>http://www.phpgenious.com/2009/03/block-proxy-servers-using-htaccess/</link>
		<comments>http://www.phpgenious.com/2009/03/block-proxy-servers-using-htaccess/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 06:43:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTACCESS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[.HTACCESS Tips]]></category>

		<guid isPermaLink="false">http://www.phpgenious.com/?p=220</guid>
		<description><![CDATA[Hello Friends !! We all know about spamming. In my last post we can block IP address using .HTACCESS. But suppose proxy server used for spamming then what will you [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Friends !!</p>
<p>We all know about spamming.</p>
<p>In my last post we can block IP address using .HTACCESS. But suppose proxy server used for spamming then what will you do ? In using proxy server, every time IP address changed.</p>
<p>Generally hackers are also use proxy servers to hack the site.</p>
<p>Don&#8217;t worry about this. I found some code of .HTACCESS which blocks proxy servers to access your site.</p>
<h4>How to Block Proxy Servers</h4>
<p>This code help you to block proxy servers to access your site.</p>
<p><span id="more-220"></span></p>
<div class="code">
<p>RewriteEngine on<br />
RewriteCond %{HTTP:VIA}                 !^$ [OR]<br />
RewriteCond %{HTTP:FORWARDED}           !^$ [OR]<br />
RewriteCond %{HTTP:USERAGENT_VIA}       !^$ [OR]<br />
RewriteCond %{HTTP:X_FORWARDED_FOR}     !^$ [OR]<br />
RewriteCond %{HTTP:PROXY_CONNECTION}    !^$ [OR]<br />
RewriteCond %{HTTP:XPROXY_CONNECTION}   !^$ [OR]<br />
RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [OR]<br />
RewriteCond %{HTTP:HTTP_CLIENT_IP}      !^$<br />
RewriteRule ^(.*)$ &#8211; [F]</p></div>
<p>You have to simply copy this code into your siteâ€™s root <acronym title="Hypertext Access">htaccess</acronym> file.</p>
<p>Upload to your server, and test it. If any problem then comment me.<br />
<!--adsense#DeleteJQueryRecords--><br />
Original article by Perishable Press: <a href="http://perishablepress.com/press/2008/04/20/how-to-block-proxy-servers-via-htaccess/">http://perishablepress.com/press/2008/04/20/how-to-block-proxy-servers-via-htaccess/</a></p>
<p>Thanks&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpgenious.com/2009/03/block-proxy-servers-using-htaccess/feed/</wfw:commentRss>
		<slash:comments>89</slash:comments>
		</item>
		<item>
		<title>Block IP addresses Using .HTACCESS</title>
		<link>http://www.phpgenious.com/2009/03/block-ip-addresses-using-htaccess/</link>
		<comments>http://www.phpgenious.com/2009/03/block-ip-addresses-using-htaccess/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 06:33:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTACCESS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[.HTACCESS Tips]]></category>

		<guid isPermaLink="false">http://www.phpgenious.com/?p=217</guid>
		<description><![CDATA[Hello Friends !! In my previous post, i was write how to block IP address using PHP script ? Today i will write that how to block IP address using [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Friends !!</p>
<p>In my previous post, i was write how to block IP address using PHP script ?</p>
<p>Today i will write that how to block IP address using .HTACCESS ?</p>
<p>There are several ways to block a specific IP range.</p>
<p>The first utilizes a CIDR number to block the specified range (via htaccess):</p>
<div class="code"># block IP range by CIDR number<br />
&lt;Limit GET POST PUT&gt;<br />
order allow,deny<br />
allow from all<br />
deny from 214.53.25.64/26<br />
&lt;/Limit&gt;</div>
<p><span id="more-217"></span><br />
The second method is similar, only here we are expressing the range in netmask notation, using corresponding network/netmask values:</p>
<div class="code"># block an IP range via network/netmask values<br />
&lt;Limit GET POST PUT&gt;<br />
order allow,deny<br />
allow from all<br />
deny from 214.53.25.64/255.255.255.192<br />
&lt;/Limit&gt;</div>
<p>The third method tests all IP addresses against a predefined regular expression via RewriteCond/RewriteRule directives:</p>
<div class="code">RewriteEngine On<br />
RewriteCond %{REMOTE_ADDR} ^214\.53\.25\.(6[4-9]|7[0-9]|8[0-9]|9[0-9])$ [OR]<br />
RewriteCond %{REMOTE_ADDR} ^214\.53\.25\.1([0-1][0-9]|2[0-8])$<br />
RewriteRule .* &#8211; [F]</div>
<p>Here is a way of blocking a specific ISP via its IP address(es).</p>
<div class="code">&lt;Files *&gt;<br />
Order Allow,Deny<br />
Allow from all<br />
Deny from 123.123.123.<br />
Deny from 456.456.456.<br />
&lt;/Files&gt;</div>
<p>There is probably a more efficient way to write the regular expressions in the previous example, but that should definitely get the job done.</p>
<p>I think this post become useful to you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpgenious.com/2009/03/block-ip-addresses-using-htaccess/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
