How to assign different separate domain for a Drupal page using Nginx

A client asked me to work on one particular page of his existing Drupal site to have its own different separate domain. This is one good solution if you have special web page that you want to quickly improve ranking on search engines.

Lets say, the http://www.webfoobar.com/node/88 is the page that we want it to have its own domain "test7.webfoobar.com". The following steps will accomplish this task:

Nginx solution to web static files are blocked by CORS policy: No 'Access-Control-Allow-Origin' header

If a website is trying to access web static files from different URL domain, broken web assets and the following error will occur:

Access to Font at 'https://www.webfoobar.com/sites/webfoobar.com/themes/custom/mybootstrap/fonts/sniper.woff?1887860575' from origin 'https://test7.webfoobar.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://test7.webfoobar.com' is therefore not allowed access.

Tags

Remote Linux server PHP debugging using PhpStorm Xdebug with its port forwarded through SSH tunnel

If your client's site setup is complicated and you don't have time to replicate it in your local machine, your choice is to debug it directly. This article will show steps on how to debug a website's PHP codes remotely in a server with firewall specifically hosted in Linode server running Centos 7 64-bit Linux distribution, PHP-FPM (FastCGI Process Manager) and PHP 7.0 (the server is running multiple PHP versions).

Showing Drupal taxonomy terms' hierarchical structure in Views

This guide will show how to display Drupal taxonomy terms' hierarchical structure in Views. It is assumed that you have already existing setup of your own taxonomy terms hierarchical structure, a content type which has a field referencing your vocabulary with taxonomy terms hierarchical structure and posted nodes of this content type tagged with one of these taxonomy terms.

In this guide we will use the Drupal vocabulary that has the following structure as our example:

Solution to Drupal site's page's URL all contains its root path

I had a Drupal project where the website is hosted in shared web hosting and the issue was all its page's URL contains root path like for example: http://example.com/home/roland/public_html/contact (this URL should only be http://example.com/contact if without root path). We know that in shared hosting we don't have control in Apache web server's configuration files but we do only have the .htaccess to do some Apache stuffs. How can we remove the root path /home/roland/public_html from all our Drupal site's URL?