Skip to content

Instantly share code, notes, and snippets.

View davidduong90's full-sized avatar
🎯
Focusing

David Duong davidduong90

🎯
Focusing
View GitHub Profile
@davidduong90
davidduong90 / magento-1-2-migration-update-urls
Created November 10, 2023 08:30 — forked from collymore/magento-1-2-migration-update-urls
Replace Magento 2 url_key with correct value from Magento 1
<?php
ini_set('max_execution_time', 0);
ini_set('display_errors', 1);
require __DIR__ . '/../app/bootstrap.php';
use \Magento\Framework\App\Bootstrap;
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$state = $objectManager->get('\Magento\Framework\App\State');
@davidduong90
davidduong90 / .htaccess for WP subdirectory installation
Created September 12, 2022 03:22 — forked from quinncomendant/.htaccess for WP subdirectory installation
This .htaccess file works with Wordpress installed under a subdirectory wp/ inside the document root.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
# Make the admin still accessible from /wp-admin
RewriteCond %{REQUEST_URI} ^/wp-admin/?(.*)
RewriteRule .* wp/wp-admin/$1 [L,R=301]
RewriteCond %{REQUEST_URI} ^/wp/?$
RewriteRule .* wp/wp-admin/ [L,R=301]
# Base is the URL path of the home directory
RewriteBase /
@davidduong90
davidduong90 / mage2-multiweb-subdir.md
Created April 5, 2022 03:28 — forked from thagxt/mage2-multiweb-subdir.md
Set up Magento 2 multiple websites in sub directories

Set up Magento 2 multiple websites in sub directories

  1. Go to Admin > Stores > All Stores
  2. Click > Create Web Site
  3. In the Name field, enter store name.
    • e.g. Japan
  4. In the Code field, enter a unique string without spaces and > Save Web Site
    • e.g. super_jp
  5. Create Store
  6. Create Store View
@davidduong90
davidduong90 / .htaccess
Created July 15, 2021 08:59 — forked from Zodiac1978/.htaccess
Make your Website faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
# https://andreashecht-blog.de/4183/
@davidduong90
davidduong90 / magento-admin-user-via-database.sql
Created November 24, 2020 15:34 — forked from thestuntcoder/magento-admin-user-via-database.sql
Create Magento Admin User Through Database
LOCK TABLES `admin_role` WRITE , `admin_user` WRITE;
SET @SALT = "rp";
SET @PASS = CONCAT(MD5( CONCAT(@SALT, "super_secure_password") ), CONCAT(":", @SALT));
SELECT @EXTRA := MAX(extra) FROM admin_user WHERE extra IS NOT NULL;
INSERT INTO `admin_user` (firstname, lastname, email, username, password, created, lognum, reload_acl_flag, is_active, extra, rp_token_created_at)
VALUES ('FirstName', 'LastName', 'email@yourdomain.com', 'your_username', @PASS,NOW(), 0, 0, 1, @EXTRA,NOW());
INSERT INTO `admin_role` (parent_id, tree_level, sort_order, role_type, user_id, role_name)