How to encrypt password with PHP

We will see how to encrypt information in PHP in order to store and exchange it safely. But first, we’ll do a little reminder on symmetric cryptography. Encryption is an operation which is to alter the information to make it unreadable, but reversibly only to a specific person, who is able to decrypt that information by … Read more

Search favicons from any website using PHP

Search favicons from any website using PHP and download favicons file to your server. If you request a website URL to download favicons file like https://sadedar.com/favicon.php?url=google.com Write favicon.php file below code. <?php $userPath=$_GET[‘url’]; // you can use GET or POST method. require ‘FaviconDownloader.class.php’; $favicon = new FaviconDownloader($userPath); if($favicon->icoExists){ echo “Favicon found : “.$favicon->icoUrl.”\n”; // Saving … Read more

Leverage browser caching for .htaccess

How to do Leverage browser caching for .htaccess. Below code will tells browsers what to cache and how long to “remember” it a browser.  Top of your .htaccess file place below code. Leveraging browser caching can significantly improve the speed and performance of your website. Here’s how you can set up browser caching for your website’s .htaccess … Read more

How to Write Robots.txt for Your Website?

To exclude all robots from the entire server User-agent: * Disallow: / To allow all robots complete access User-agent: * Disallow: (or just create an empty “/robots.txt” file, or don’t use one at all) To exclude all robots from part of the server User-agent: * Disallow: /cgi-bin/ Disallow: /tmp/ Disallow: /junk/ To exclude a single … Read more

How to display links in a WordPress excerpt?

Allowing link in a excerpt very common issue for WordPress users. You can display excerpt link by adding this script to your theme “functions.php” file. remove_filter( ‘the_excerpt’, ‘wp_trim_excerpt’ ); function new_trim_excerpt($text) { global $post; if ( ” == $text ) { $text = get_the_content(”); $text = apply_filters(‘the_content’, $text); $text = str_replace(‘\]\]\>’, ‘]]>’, $text); $text = preg_replace(‘@<script[^>]*?>.*?</script>@si’, ”, $text); … Read more

How to remove index.php From Website URL?

Remove index.php from any Website URL to keep away from Google duplicate content penalty. It will increase your website home page visibility in all major search engine. RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC] RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]