Skip to content

Instantly share code, notes, and snippets.

View sdhundhalva's full-sized avatar
🏠
Working from home

Shailesh Dhundhalva sdhundhalva

🏠
Working from home
View GitHub Profile
@sdhundhalva
sdhundhalva / .htaccess
Created June 7, 2022 07:10
http to https & www to non-www redirects htaccess rule
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@sdhundhalva
sdhundhalva / functions.php
Created July 2, 2020 15:54
All in One WordPress Migration Increase Upload limit from 256 MB to 512MB
<?php
add_filter( 'upload_size_limit', 'dg_increase_upload' );
function dg_increase_upload( $bytes )
{
return 536870912; // 512 MB
}
@sdhundhalva
sdhundhalva / Fixed-Media-upload-http-error.php
Last active January 8, 2019 07:27
Fixed WordPress WP-Media uploading error. Put this code in functions.php file.
<?php
/*
* Resolve HTTP Error.
*/
function ms_image_editor_default_to_gd($editors){
$gd_editor = 'WP_Image_Editor_GD';
$editors = array_diff( $editors, array( $gd_editor ) );
array_unshift($editors, $gd_editor);