Skip to content

Instantly share code, notes, and snippets.

View mskian's full-sized avatar
🦕
Focusing

Santhosh Veer mskian

🦕
Focusing
View GitHub Profile
@mskian
mskian / .htaccess
Created January 16, 2016 11:53
Complete htaccess code for remove file extension + add a trailing slash like wordpress
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
#RewriteRule ^([a-z]+)\/?$ $1.php [NC]
RewriteCond %{REQUEST_FILENAME} !-d
@mskian
mskian / .htaccess
Created March 10, 2016 03:44
HTACCESS CODE FOR ACTIVATE THE HTTPS VERSION FOR SINGLE DOMAIN
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
@mskian
mskian / .htaccess
Created March 10, 2016 03:56
htaccess code for non-www to www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
@mskian
mskian / .htaccess
Created March 10, 2016 03:59
htaccess code for activating an SSL for Specific Folder (Example - Payment Gateway Link)
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} folder
RewriteRule ^(.*)$ https://www.example.com/folder/$1 [R,L]
# BEGIN Cache Enabler
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# set blog sub path
SetEnvIf Request_URI "^(.*)$" SUB_PATH=/wp-content/cache/cache-enabler/
# set Cache Enabler path
SetEnvIf Request_URI "^(.*)$" CE_PATH=$1
## EXPIRES HEADER CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
<?php
include('db.php');
include('logincheck.php');
if(isset($_POST['create-ref']))
{
$user=mysqli_real_escape_string($con,$_POST["user"]);
$user=htmlentities($user);
<?php
include("db.php");
$str=mysqli_real_escape_string($con,$_GET["str"]);
//select user
$sql_query="SELECT * FROM referral WHERE str='$str'";
$result_set=mysqli_query($con,$sql_query) or die('error');
$user_ref=mysqli_fetch_array($result_set);
<?php
//status.php?id=USER_ID
include('db.php');
if($_GET['id'])
{
//variables
$id=mysqli_real_escape_string($con,$_GET["id"]);