Posts tagged .HTACCESS Tips

Redirect to https (SSL) in php

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 :

SSL meand Secure Socket Layer. It is developed by Netscape to transmit private data via Internet.

SSL uses a cryptographic system that uses two keys to encrypt data – 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:

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.

Most of the sites use http protocol. But in above case wehave to redirect browser to https.
If you want to see example, write “http://www.gmail.com” in browser, it automatically redirects to https.It means site transfer to SSL protocol.

First of all, you should know that SSL must be installed in the server. To redirect the browser to “https” , 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 “HTTPS”. $_SERVER['HTTPS'] returns “on” values when the site is using SSL connection.
More >

Block Proxy Servers using .htaccess

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 do ? In using proxy server, every time IP address changed.

Generally hackers are also use proxy servers to hack the site.

Don’t worry about this. I found some code of .HTACCESS which blocks proxy servers to access your site.

How to Block Proxy Servers

This code help you to block proxy servers to access your site.

More >

Block IP addresses Using .HTACCESS

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 .HTACCESS ?

There are several ways to block a specific IP range.

The first utilizes a CIDR number to block the specified range (via htaccess):

# block IP range by CIDR number
<Limit GET POST PUT>
order allow,deny
allow from all
deny from 214.53.25.64/26
</Limit>

More >

More Useful .HTACCESS tips and Tricks

Hello Friends !!

I am back with .htaccess tips and tricks. Today i found one document whick contains lots of .htaccess tips and tricks.

This document in about 12 to 13 pages. So today i cant write all these tricks in my post.

But i will give you that document. You have to download that document from this site.

But one thing you have to do for this. Please give me comments and please share this post and my all posts.

Here you can DOWNLOAD this document.

Please..Please..Please comment on this post.

Thanks to all of you….

Upload Large files using .htaccess in PHP

Hello Friends !!

In PHP, on server somekind of error occures when you upload large files.

If you work on localhost then you can change four parameters in php.ini file.
More >

URL rewriting Tips and Tricks in .htaccess – PHP

Hello friends !!

Today i want to give you some more .htaccess tips and tricks for url rewriting in PHP.

In my last post, i was show you basick url rewriting. In this post i will write some more .htaccess tricks for you.

Control Access

Being able to control access to certain areas of your server can be very useful. The following example demonstrates how to only allow access from those connecting from a 192.168.0 LAN IP pool. This could be easily modified to only allow access from a single remote IP address or addresses.

order deny,allow
deny from all
allow from 192.168.0.0/24

Shorter URLs

Shorter URLs are beneficial, as visitors that persist in typing full URLs won’t have to type as much, and they’re more memorable. Do they benefit SEO, even though the full URL contains the same keywords? I don’t know, maybe someone can tell me.

This example will rewrite a page requested as http://xyz.com/files/code/apache.zip to http://xyz.com/download.php?type=code&file=apache.

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^files/(.+)/(.+).zip download.php?type=$1&file=$2 [nc]

More >

Get Adobe Flash playerPlugin by wpburn.com wordpress themes
-->