Loading

Leverage Browser Caching

  1. <IfModule mod_expires.c>
  2.   ExpiresActive On
  3.  
  4.   # Images
  5.   ExpiresByType image/jpeg "access plus 1 year"

call asp script

  1. Call RunIt()
  2. Sub RunIt()
  3. Dim RequestObj
  4. Dim URL
  5. Set RequestObj = CreateObject("Microsoft.XMLHTTP")

.htaccess Softaculous WP

  1. # Ficheiro .htaccess Softaculous WP Sign-on
  2. # BEGIN WordPress
  3. <IfModule mod_rewrite.c>
  4. RewriteEngine On
  5. RewriteBase /

Redirect http to https PH

  1. <?php
  2. if(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off"){
  3.     $redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
  4.     header('HTTP/1.1 301 Moved Permanently');
  5.     header('Location: ' . $redirect);

Teste E-mail por mail()

  1. <!DOCTYPE html>
  2. <html lang="en">
  3.   <head>
  4.     <meta charset="utf-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

Exemplo de pipe em PHP

  1. #!/usr/bin/php -q
  2. <?php
  3. $rawData = file_get_contents("php://stdin");
  4. file_put_contents("teste.txt", $rawData);
  5. ?>

Teste de Ligação PHP

  1. <?php
  2. error_reporting(E_ALL);ini_set('display_errors', 1);
  3.  
  4. $servidor = "endereco.do.servidor";
  5. $porta = "1234";

Aceder a BD MySQL via mys

  1. <?php
  2. $dbname = '';
  3. $dbuser = '';
  4. $dbpass = '';
  5. $dbhost = 'localhost';

Aceder a BD MySQL - Teste

  1. <?php
  2.  
  3. $dbname = '';
  4. $dbuser = '';
  5. $dbpass = '';

Malware Scanner

  1. <?php
  2.  
  3. if($_GET['acao'] == "eliminar") {
  4.     unlink($_GET['ficheiro']);
  5.     echo "<p color=\"red\">Ficheiro ". $_GET['ficheiro'] ." eliminado com sucesso!</p>";

WordPress wp-login.php Au

  1. # BEGIN WEBTUGA SECURITY
  2.  
  3. ErrorDocument 401 "Unauthorized Access"
  4. ErrorDocument 403 "Forbidden"
  5. <FilesMatch "wp-login.php">

Redireccionar http para h

  1. # Redireccionar para HTTPS
  2. RewriteCond %{HTTPS} off
  3. RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

.htaccess mod_deflate

  1. <IfModule mod_deflate.c>
  2.     SetOutputFilter DEFLATE
  3.     <IfModule mod_setenvif.c>
  4.         # Netscape 4.x has some problems...
  5.         BrowserMatch ^Mozilla/4 gzip-only-text/html

Redirect .htaccess subdir

  1. RewriteEngine On
  2. RewriteRule ^$ /newsite [L]

WordPress Default .htacce

  1. # BEGIN WordPress
  2. <IfModule mod_rewrite.c>
  3. RewriteEngine On
  4. RewriteBase /
  5. RewriteRule ^index\.php$ - [L]