Monthly Archives: June 2017

Convert youtube URL to embed code

Reference:

  1. https://stackoverflow.com/questions/22544625/javascript-convert-youtube-vimeo-urls-into-embed-versions-for-use-on-a-forum

Woocommerce thank you page

Variable $order in thankyou.php will be created by order key from URL. e.g. key=wc_order_593a3d1583f2e

So, it’s important to make sure return URLs of payment gateways include this param or thank you page won’t display order info and purchase event of Facebook pixel will not work neither.

Reference:

  1. How to get order key:
    https://stackoverflow.com/questions/37669956/woocommerce-get-order-key

Create Virtual host on EC2 (ubuntu)

Steps

  1. sudo mkdir -p /var/www/rex.com/
  2. sudo chown -R ubuntu:www-data /var/www/rex.com/
  3. sudo chmod -R 755 /var/www/
  4. cd /etc/apache2/sites-available/
    sudo cp 000-default.conf rex.com.conf
    sudo nano rex.com.conf
  5. sudo a2ensite rex.com.conf
  6. sudo service apache2 restart

Reference:

  1. http://diary.taskinghouse.com/posts/664386
  2. https://nouveauframework.org/blog/vhosts-running-multiple-sites-on-a-single-aws-ec2-instance/