domain redirect

Usually we develop the site on developement or subdomain and when we finally mirgate the to new domain then some of thing will remain or page redirect happens in  sometimes , so In this case .htaccess file helps to redirect all your olddomain pages to new one 

Below is the code will helps to redirect the olddomain to new domain, should be written in .htaccess file on your root folder

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^yourolddomain.com$ [OR]
  RewriteCond %{HTTP_HOST} ^www.yourolddomain.com$
  RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
</IfModule>

Hopes this articles helps, thanks


Please Comment your thoughts and feedback below and add something if you found good in anywhere to help others

Hit a like Button If you like the Post.

Many Thanks

Add new comment

Other Articles

Slice array Elements using Keys PHP

Many Helpful Function are available to exact the specific set of keys of an array $sliced-arr = array_slice($new_tags, 0, 6);

Uncaught TypeError: CKEDITOR.tools.object.keys is not a function

Intergation of code snippet with ckeditor, cause this error "Uncaught TypeError: CKEDITOR.tools.object.keys is not a function".

Use Drush in Cron to execute the task in multiple Drupal Instance..

As many of us using drush as command line tool for drupal for various task because it is easy to use and save time for searching dependency of module and libraries for various of module, In this tu

Important Mysql Commands that will we used with ssh

Commands Access monitor: mysql -u [username] -p; (will prompt for password) Show all databases: show databases;

Bootstrap 4 Uncaught TypeError: Cannot read property 'fn' of undefined

while using bootstrap 4 we usually get this kind of error and jquery bootstrap.min.js is working correctly Error  is:

Print array or object in watchdog drupal 8

Similar to drupal 7, Drupal 8 also provide the logging functionality but little different to use it because the drupal 8 is symphony base architecture, so can use the logger service of drupal 8 to

Drupal 7 Multisite setup

Here is some links will helps to create a multisite of drupal 7 

Search word or file Using SSH(Putty)

Fastest and efficient way is to use grep command For search in a file : grep "wordtofind" config.php

Create a Flag link programmatically and render flag link in twig template drupal 8

This article is refer to generate the flag link programmatically and render in drupal 8 twig template, before in drupal 7 its was quiet easy to render or generate flag link in just a single line of

Drupal 8 Opcache Problem with xampp

;Put this code in php.ini (C:\xampp\php\php.ini) zend_extension=php_opcache.dll [opcache] ; Determines if Zend OPCache is enabled opcache.enable=1 ; Determines if Zend OPCach

[SOLVED] PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting

If you get the same error like below in VScode editor then you are the right place to 

Drupal 8 add custom menu classes to using menu.html.twig

In Drupal 8 Twig templates give extra power to drupal to add dynamic content in twig style, In this tutorial we can see how we can add the custom menu classes to menu ul li using menu.html.twig.

Jquery prevent enter to submit form

If you want to prevent the form submit using jquery, then this page helps you to doing this. Code:

Get average number with PHP

<?php //put all integer in array $array = array(9,18,9,5,6,45); //Calculate the average. $average = array_sum($array) / count($array);

Schema API Drupal not accept the datatype like date or datetime

Schema  Api Drupal 7 and Drupal 8 not accept the datatypes Like data or datatime and generate the warning and sql syntax error while installing the drupal module in install  normally we

Menu template in drupal 8 for specific customization

Drupal 8 gives the flexibility to make menu template and design the menu with our need, to do this --

Install JAVA 8 on Ubuntu 18.04/16.04

Install java on Ubuntu 1)Install Oracle Java 8 

How to Stop Search Engines from Crawling your Website

search engine crawlers are very required to reach audience to your website, but if they hit continuous it will harm your website performance, If you want to prevent search engine crawler to crawl h

Print array or object in watchdog drupal 7

hey, For many purpose we have to print the array or object while making a custom modules or debuging any old module, we have to print the array or object to see the values are fine or not, drupal p

Send file as Email attachment using hook_mail_alter drupal 7 programmatically (example webform submit)

Hi guys, In this tutorial we can see how we can send files as attachments in drupal 7 on webform submit using a hook_mail_alter 

Important SSH Commands

Copy folder from one location to another by excluding specified folder .  - rsync -av --progress sourcefolder /destinationfolder --exclude thefoldertoexclude

Check the size of folder, files and directories using SSH

Following commands(In Bold) used for different purpose  1. Use df -h For check out the used space, free space and total space From all the partitions.

Creating a Self-Signed SSL Certificate linux/centos

Self Signed certificates are those are signed by the same individual whose identity it certifies.

Recent Posts

Drupal 8: check user is logged in or not in *.html.twig

In the new era the drupal8 twig is introduce, so old basic php drupal hook is not useful in theme templates.

Add text to ckeditor textarea using jquery

In most of case we need to add or fill up form fields using jquery or Js, if you have trobble in loading data in textarea having ckeditor working already then this tutorial helps you.

How to Add a Custom Date Format in Drupal 8

In drupal 8 there is easiest way to add the date format is simply go link for your website

Retrieve the query used in mysql views

we can create the database views for many reason, but if we forget what query you was used to create the views or need to find out using which query results are generating here is the solution:

Send file as Email attachment using hook_mail_alter drupal 7 programmatically (example webform submit)

Hi guys,

In this tutorial we can see how we can send files as attachments in drupal 7 on webform submit using a hook_mail_alter 

[SOLVED] PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting

If you get the same error like below in VScode editor then you are the right place to 

Create a Flag link programmatically and render flag link in twig template drupal 8

This article is refer to generate the flag link programmatically and render in drupal 8 twig template, before in drupal 7 its was quiet easy to render or generate flag link in just a single line of

Jquery prevent enter to submit form

If you want to prevent the form submit using jquery, then this page helps you to doing this.

Code:

Play Pause HTML5 Video using Jquery

HTML5 video playing on any web page is very easy, in this tutorial we can show you how to add video on html and make it play and pause without using html controls.

Import and Export Drupal 8 Views, Or Import and Export any configuration Drupal 8

Import and Export configuration is the basic protocol to staging the website or production website deployment, In Drupal 7, we need the extra modules to import and export or we can use features mod

How to override different version of Jquery in Drupal 8 using theme

Drupal 8 use its own jquery version by default and if you want to use the other version of jQuery instead of default than this tutorials steps is for you, sometimes we need different version to oth

Subscribe to Mailchimp programmatically via api with PHP

In this tutorial we can see how to subscribe to the mailchimp subscribe list using php programmatically via api,

For this you need a mailchimp account, api key and list id