NOTE

REDIRECTION USING  htaccess.

Redirect from old URLs to new URLs with specific URLs

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

Redirect a Whole Domain to a New Domain

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{HTTP_HOST} ^oldsite.com [NC,OR]
 RewriteCond %{HTTP_HOST} ^www.oldsite.com [NC]
 RewriteRule ^(.*)$ https://newsite.com/ [L,R=301,NC]
</IfModule>

Upload file via SSH on Ubuntu server

scp <file> <username>@<IP address or hostname>:<Destination>

For example: my file "example.zip"

scp example.zip admin@124.76.61.243:/home/admin/web/example.com/public_html/

Error Cropping image fixed in WordPress

# Debian/Ubuntu

Run the following command

#PHP5
$ sudo apt-get install php5-gd

#PHP7
$ sudo apt-get install php7.0-gd
or
$ sudo apt-get install php7.2-gd

Install PHP extension soap PHP 7.2 on Ubuntu 18.4 to Avoid AAWP error

* Views Version PHP first
php -v

* Install php extension soap PHP 7.2 on Ubuntu 18.4  ( 7.2 is your PHP version )
sudo apt-get install php7.2-soap
sudo systemctl restart apache2
*If error try 
sudo apt update before installing.

Downloading the file into a folder

* Upload files to a specific folder
wget https://wordpress.org/latest.zip

Installing plugin to use unzip the zipped file in Ubuntu

* Install plugin zip in ubuntu
sudo apt-get install unzip

* Example:
zip -r myfiles.zip myfiles

- install vi in ubuntu
sudo apt-get install vim

* Restart Server
sudo reboot

Renaming file or folder in Ubuntu

mv wordpress wordpress1

Moving file in Ubuntu

mv -r wordpress ~/web/domain/public_html/.....  (move "wordpress" folder to "..." Path)

How to install PHP SOAP Extension

* Views Version PHP

php -v *

Install php extension soap PHP 7.2 on Ubuntu 18.4

sudo apt-get install php7.2-soap

sudo systemctl restart apache2

Create a Text File Quickly with Linux

$ cat > SampleTextFile.txt

To view

$ cat filename.txt

To Edit

$ nano sampletouchfile.txt

Create Zip Archive File in Linux

$ zip -r filename.zip filename

Reinstall Phpmyadmin

cd /usr/share/

sudo cp -r phpmyadmin/ phpmyadmin_backup

cd phpmyadmin/

sudo rm -r *

sudo wget https://files.phpmyadmin.net/phpMyAdmin/5.1.1/phpMyAdmin-5.1.1-all-languages.zip

sudo unzip phpMyAdmin-5.1.1-all-languages.zip

cd phpMyAdmin-5.1.1-all-languages

sudo mv * /usr/share/phpmyadmin

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top