Website Management – Advanced - AwardSpace.com https://www.awardspace.com/kb/website-management-advanced/ Free Web Hosting with PHP, MySQL, Email Sending, No Ads Sun, 28 Jul 2024 06:36:03 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.3 https://www.awardspace.com/wp-content/uploads/2022/09/awardspace-favicon-120x120.png Website Management – Advanced - AwardSpace.com https://www.awardspace.com/kb/website-management-advanced/ 32 32 How to Make a 301 Redirect Using .htaccess https://www.awardspace.com/kb/how-to-make-a-301-redirect-using-htaccess/ Tue, 23 Jul 2024 06:42:05 +0000 https://www.awardspace.com/?p=75007 There are multiple ways to make a 301 redirect from one part of your website to another. By far the best way is to use the .htaccess configuration file. The 301 Redirect is a permanent redirection from one URL to another. Such redirections are useful for SEO, and other reasons but your reason to permanently […]

The post How to Make a 301 Redirect Using .htaccess appeared first on AwardSpace.com.

]]>
There are multiple ways to make a 301 redirect from one part of your website to another. By far the best way is to use the .htaccess configuration file. The 301 Redirect is a permanent redirection from one URL to another. Such redirections are useful for SEO, and other reasons but your reason to permanently redirect one URL to another is up to you.

NB! Although it is called a permanent redirect, you can always reverse it, by removing the instructions from your .htaccess file. Yet it is important to note that if a page was 301 redirected, Google and other search engines will accept it as permanent. Therefore, it will be a lot harder to rank the same URL once it was associated to another via a permanent redirect.

 

How to Make a 301 Redirect

To make a 301 permanent redirect using the .htaccess configuration file, naturally, the first thing you need to do is to access the file. Go to the root directory of your website with our file manager or using an FTP.

Related:

 

If the .htaccess file does not exist, create a new file and name it .htaccess.

Now that you have created an .htaccess configuration file, simply open the file with any text editor, and add the lines that are needed to make the redirect. Before we go to the lines, we ought to remind you that you can edit the .htaccess file in the hosting control panel. There is no need to download the file, or any additional software.

 

301 Redirect for a Single Page

To redirect a single page, use the following syntax:

Redirect 301 /old-page.html http://www.yourwebsite.com/new-page.html

Replace /old-page.html with the path to the old page. Replace http://www.yourwebsite.com/new-page.html with the full URL of the new page.

 

301 Redirect an Entire Domain

To redirect an entire domain to a new domain, use the following syntax:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-domain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.old-domain.com [NC]
RewriteRule ^(.*)$ http://www.new-domain.com/$1 [L,R=301,NC]

 

Replace old-domain.com with your old domain name. Replace http://www.new-domain.com with your new domain name.

 

Redirecting All Pages to a New Domain

To redirect all pages from an old domain to the corresponding pages on a new domain:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-domain.com$ [NC]
RewriteRule ^(.*)$ http://new-domain.com/$1 [R=301,L]

Replace old-domain.com with your old domain name. Replace new-domain.com with your new domain name.

 

After you’ve made the necessary adjustments to your .htaccess file, don’t forget to save it. Either upload the file back to the website’s root directory, or if you edited it in the control panel, click the save button.

What is left for you to do is to test whether the redirects are working as intended and whether the website is working as it was before.

 

Example

If you want to redirect http://www.yourwebsite.com/old-page.html to http://www.yourwebsite.com/new-page.html, your .htaccess file should look like this:

RewriteEngine On
Redirect 301 /old-page.html http://www.yourwebsite.com/new-page.html

 

The post How to Make a 301 Redirect Using .htaccess appeared first on AwardSpace.com.

]]>
How to force HTTPS with .htaccess https://www.awardspace.com/kb/force-https-with-htaccess/ Tue, 13 Jul 2021 15:40:37 +0000 https://www.awardspace.com/?p=50174 Security has become an important part of every website. Almost every website which you visit now has an SSL Certificate installed. We also have a detailed guide that can help you to install an SSL Certificate. However, installing an SSL Certificate alone on your website would not secure it. To make sure that your SSL […]

The post How to force HTTPS with .htaccess appeared first on AwardSpace.com.

]]>
Security has become an important part of every website. Almost every website which you visit now has an SSL Certificate installed. We also have a detailed guide that can help you to install an SSL Certificate. However, installing an SSL Certificate alone on your website would not secure it. To make sure that your SSL Certificate is active you would have to force an HTTPS connection for your website. In this article, we will show you how to force HTTPS on your website using a .htaccess file.

 

Forwarding all Traffic to HTTPS

While most CMS, used to create a website, have the option to force HTTPS for your website with just one click. However, other websites require some additional configurations to the website to redirect the traffic to HTTPS. This is achieved using .htaccess and one of its many functions, the 301 redirects. To force all of the incoming to your website traffic to use HTTPS follow the steps below:

  1. Go to the File Manager in your Hosting Control Panel
  2. Create a .htaccess file if it does not exist
  3. Open the .htaccess file and add the following code:
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  4. Save the changes

Make sure that RewriteEngine On is not repeated twice. In case it exists, simply copy the rest of the code without it.

 

Forwarding to HTTPS for a Specific Domain

Forcing HTTPS for a specific domain would be used in cases where you have multiple domains that point to the same website. However, you want to force HTTPS only for one of the domains. If you would like to achieve that simply use the code below:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Make sure to replace yourdomain.com with the domain name for which you would like to force HTTPS.

 

Forwarding to HTTPS for a Specific Directory

Using .htaccess you can also force HTTPS for specific directories. However, the .htaccess file needs to be placed in the directory in which you would like to have the redirection enabled:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(folder1|folder2|folder3) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

In the above code, you should replace the folder with the name of the actual directory.

We also have a .htaccess Generator which you can use to generate a .htaccess file for blocking and forwarding traffic or for setting up custom error pages.

The post How to force HTTPS with .htaccess appeared first on AwardSpace.com.

]]>
How to Manually Backup your Website? https://www.awardspace.com/kb/how-to-manually-backup-your-website/ Tue, 08 Jun 2021 12:26:53 +0000 https://www.awardspace.com/?p=49441 Maintaining a website can be a hard task. If you are running a CMS such as WordPress, you need to keep your CMS, plugins, and themes up to date. In addition to that, you should also be backing up your website. Although we have an automatic backup system we still encourage our users to manually […]

The post How to Manually Backup your Website? appeared first on AwardSpace.com.

]]>
Maintaining a website can be a hard task. If you are running a CMS such as WordPress, you need to keep your CMS, plugins, and themes up to date. In addition to that, you should also be backing up your website. Although we have an automatic backup system we still encourage our users to manually backup their websites as well. In this article, we will guide you through the process of how to manually backup your website files and database.

 

How to backup your files?

In order to back up your files, you will have to connect to your hosting account via FTP. Once you have connected to the FTP download your website directory to your device. Some websites have a lot of files and directories and thus your download might take some time.

If you would like to download your website faster you can contact us via a trouble ticket and request our technical support to archive your website directory. Once this is done you can download the archive file.

 

How to backup your database?

Most websites store their content inside a database. Thus backing up the files for your website would not be enough. There are two ways which you can use to backup your database:

  • via the phpMyAdmin
  • via the Database Manager

To backup your database via the Database Manager follow the steps below:

  1. Login to your Hosting Control Panel
  2. Access the Database Manager
  3. Click on your Database
  4. Open the Management tab
  5. Click on Download in SQL Format button
  6. Save your database on your device
database-backup

This will archive all your database tables. If you would like to choose which tables to backup you will have to use the phpMyAdmin. To login to the phpMyAdmin go to the phpMyAdmin and under Management click the phpMyAdmin link.

Once inside the phpMyAdmin you will see all tables that store your website data. To download all your tables open the Export tab and click the Go button.

If you would like to export specific tables from your database, select them as shown on the screenshot and choose the Export option from the dropdown menu.

Congratulations, you have successfully backed up your database.

 

Final Thoughts

Backing up your website is important and should be done as frequently as you need. This is usually done after performing an update to your website. When using CMS such as WordPress you can use plugins in order to backup your website. An example of such a plugin is the UpdraftPlus.

The post How to Manually Backup your Website? appeared first on AwardSpace.com.

]]>
What MySQL Commands Are Used to Import/Export an SQL File Over SSH? https://www.awardspace.com/kb/ssh-mysql-import-export-sql-file/ Thu, 26 Mar 2020 08:26:02 +0000 https://www.awardspace.com/?p=45253 Our MySQL servers offer great flexibility when it comes to importing and exporting SQL files to and from your database. We allow three distinct ways of achieving this task. You can either use the Database Manager sectionof our Control Panel, you may opt to use the phpMyAdmin utility instead, or you can connect straight to […]

The post What MySQL Commands Are Used to Import/Export an SQL File Over SSH? appeared first on AwardSpace.com.

]]>
Our MySQL servers offer great flexibility when it comes to importing and exporting SQL files to and from your database. We allow three distinct ways of achieving this task. You can either use the Database Manager sectionof our Control Panel, you may opt to use the phpMyAdmin utility instead, or you can connect straight to our servers via an SSH connection and issue MySQL commands to import/export your SQL file.

In this article, we will focus on that third option and will show you how you can use Terminal or a similar application to establish an SSH connection. Then, we will go over how to use the MySQL command line to import or export your data.

 

Am I Allowed to Use the SSH Functionality?

Before you can start issuing MySQL commands, you first need to connect to our servers via a secure shell (SSH) connection. As a security precaution, we allow only our web hosting servers to communicate with the database servers. In other words, you cannot issue MySQL commands from your own computer directly to the database server. Instead, you need to log onto our web server first and then issue your MySQL commands from there. The only exception to this rule is our array of VPS hosting packages.

SSH is a fairly advanced feature and as such, it is not available on all of our shared hosting plans. You need to be using either our Web Pro Plus or Max Pack Plus hosting plan. Clients who own a Semi-Dedicated web server can also take full advantage of our SSH functionality. SSH is currently not available on our Basic and free website hosting service.

How Do I Connect to the Server via SSH?

To connect to our servers via SSH, follow the steps below:

  1. Go to the SSH Manager section of our Control Panel.
  2. Make a note of the SSH information that is provided. If you are new to the SSH Manager and you do not have an SSH account set up yet, you can refer to our SSH Manager overview article for guidance.
The SSH Manager provides you with the information you need to establish an SSH connection to the server.
The SSH Manager provides you with the information you need to establish an SSH connection to the server.
  1. Once you have obtained your SSH information, open your SSH client of choice. Linux and macOS users can use the Terminal app. If you are running the latest version of Windows 10, you can use Windows PowerShell to initiate an SSH connection. Or, if your Windows installation is outdated, you can use a third party SSH client like PuTTY.
  2. Enter the following command into your SSH client. Be sure to replace client-id with your Client ID number and server-address with one of the hostnames found in the SSH Manager section of the Control Panel.
ssh client-id@server-address -p 2222
Our shared hosting platform uses a non-standard port for SSH connections, so you should make sure that it is correctly specified in your command.
Our shared hosting platform uses a non-standard port for SSH connections, so you should make sure that it is correctly specified in your command.
  1. Execute the connection command and enter your SSH password when prompted. If the connection is successfully established, you should be connected to our server and you should see your Client ID number as your user ID.
Success! The SSH connection was successful and we are ready to start issuing MySQL commands to the server.
Success! The SSH connection was successful and we are ready to start issuing MySQL commands to the server.

 

What Is the SSH MySQL Command to Export a Database?

In order to create a MySQL dump (backup) of your database, you need to issue the following MySQL command:

mysqldump -h database-address -u database-user -p database-name > save-directory

The above command has four placeholders that you need to update before you can successfully run it:

  • you need to replace database-address with the address of the database server that is powering your MySQL database.
  • you need to replace database-user with the username for your database.
  • you need to replace database-name with the name of your database. On our shared platform, the database-user and database-name are always identical.
  • lastly, you need to replace save-directory with the full path to the place where the database dump should be saved.

If you need help filling in the first three placeholders, you can consult our in-depth Database Manager guide where we outline where the required information can be found.

As for the save-directory placeholder, you need to choose a folder where the database backup should be saved. In our example, we will create a new folder called backup-files using the File Manager section and we will store the MySQL dump there:

The File Manager is an easy tool for organizing your files and folders on the server.
The File Manager is an easy tool for organizing your files and folders on the server.

We are creating the backup-files folder in the /home/www/ directory, so the full directory path should be /home/www/backup-files/. But as part of the full path we also need to include the name of the MySQL dump file that we wish to create. In our case, we will be calling the MySQL dump database-backup.sql. When we append this file name to the full directory, we get the complete version of the save path for our backup: /home/www/backup-files/database-backup.sql

With all of the information now available, the Terminal command for exporting our example database is complete:

mysqldump -h pdb3.awardspace.net -u 2001576_test -p  2001576_test > /home/www/backup-files/database-backup.sql

When we press Enter, the command will be executed and we will be prompted to enter the password for the MySQL database that we are exporting:

Exporting a database via SSH takes a single command.
Exporting a database via SSH takes a single command.

Like most Linux commands, we do not get any sort of confirmation message that the command was carried out successfully. Instead, we can regard the lack of any error messages as proof that everything has gone well. And sure enough, if we check the File Manager we can find our shiny new MySQL backup ready and waiting:

Success! Our backup file was created successfully and we are free to download it for safekeeping.
Success! Our backup file was created successfully and we are free to download it for safekeeping.

 

What Is the SSH MySQL Command to Import a Database?

You can use the following MySQL command to import an .SQL file:

mysql -h database-address -u database-user -p database-name < file-location

For the above command to work, you need to fill the four placeholder values with the correct information:

  • you need to replace database-address with the address of the server that is powering your MySQL database.
  • you need to replace database-user with the username that is assigned to your database.
  • you need to replace database-name with the name of your database. On our shared platform, the database-user and database-name are always identical.
  • finally, you need to replace file-location with the full path to the .SQL dump on your shared hosting account.

You can obtain the necessary database information through the Database Manager section of our Control Panel. If you are not sure exactly which piece of information you need, or if you do not have a database created yet, you can read through our Database Manager overview.

The file-location must be a local file path for your .SQL dump. In our example, we have created a folder called backup-files in the /home/www/ directory and we have placed the our .SQL file called database-backup.sql inside. So our full path will be /home/www/backup-files/database-backup.sql.

With all of the above information at hand, our final MySQL command to import an .SQL file looks like this:

mysql -h pdb3.awardspace.net -u 2001576_test -p  2001576_test < /home/www/backup-files/database-backup.sql

When we run the command by pressing Enter, we will be asked for our database password. Upon providing the database password as well, the command will be executed:

No errors are present, so our .SQL file was sucessfilly imported into the MySQL database!
No errors are present, so our .SQL file was successfully imported into the MySQL database!

 

Conclusion

Admittedly, using the MySQL command line to import and export SQL files may not be the easiest approach to take. Tools like our Database Manager and phpMyAdmin offer one-click solutions that accomplish the same task. What sets these MySQL commands apart is the fact that they give you greater control over the entire process. Additionally, such commands can easily be integrated into comprehensive scripts that can run at set intervals and perform a full backup of your hosting account.

The post What MySQL Commands Are Used to Import/Export an SQL File Over SSH? appeared first on AwardSpace.com.

]]>
How to connect through SSH? https://www.awardspace.com/kb/ssh-connection/ Wed, 20 Sep 2017 13:19:34 +0000 https://www.awardspace.com/?page_id=13357 Before you connect with SSH, you need to create an SSH account. You can use the How to create an SSH account guide. To connect through SSH you need to use a telnet/SSH client. If you use Microsoft operating system, we recommend using PuTTY and following our guide on How to connect through SSH using […]

The post How to connect through SSH? appeared first on AwardSpace.com.

]]>
Before you connect with SSH, you need to create an SSH account. You can use the How to create an SSH account guide.

To connect through SSH you need to use a telnet/SSH client.
If you use Microsoft operating system, we recommend using PuTTY and following our guide on How to connect through SSH using PuTTY?
If you are on Mac or Linux you can use the integrated Terminal and connect using the ssh command.
You can also use FireSSH, which is a Mozilla Firefox add-on.

Your SSH connection settings are:
SSH host: yourdomain.com (use any hostname that is correctly hosted in your Control Panel -> Website Manager -> Domain Manager section)
Port: 2222 (the default SSH port 22 is not supported, so make sure you use 2222)
Login: Your SSH username (the SSH username is the same as your client ID)
Password: Your SSH password (the password you submitted, when you created your SSH account)

The post How to connect through SSH? appeared first on AwardSpace.com.

]]>
How to connect through SSH using PuTTY? https://www.awardspace.com/kb/putty/ Wed, 20 Sep 2017 13:18:17 +0000 https://www.awardspace.com/?page_id=13354 Before you connect with SSH, you need to create an SSH account. You can use the How to create an SSH account guide. You can download PuTTY from the official website: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Once PuTTY is installed on your computer, you can connect using your SSH details: SSH host: yourdomain.com (use any hostname that is correctly […]

The post How to connect through SSH using PuTTY? appeared first on AwardSpace.com.

]]>
Before you connect with SSH, you need to create an SSH account. You can use the How to create an SSH account guide.

You can download PuTTY from the official website:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Once PuTTY is installed on your computer, you can connect using your SSH details:
SSH host: yourdomain.com (use any hostname that is correctly hosted in your Control Panel -> Website Manager -> Domain Manager section)
Port: 2222 (the default SSH port 22 is not supported, so make sure you use 2222)

PuTTY

When you connect to the server, you will be asked for your login credentials:
Login: Your username (the SSH username is the same as your client ID)
Password: Your SSH password (the password you submitted, when you created your SSH account)

PuTTY-2

You should now be successfully connected!

The post How to connect through SSH using PuTTY? appeared first on AwardSpace.com.

]]>
How to connect through SSH using FireSSH? https://www.awardspace.com/kb/firessh/ Wed, 20 Sep 2017 13:17:17 +0000 https://www.awardspace.com/?page_id=13351 Before you connect with SSH, you need to create an SSH account. You can use the How to create an SSH account guide. You can download FireSSH from the official Firefox add-ons page: https://addons.mozilla.org/en-US/firefox/addon/firessh/ Once FireSSH is installed on your Firefox browser, you can open FireSSH from the Menu Bar -> Tools -> Web Developer […]

The post How to connect through SSH using FireSSH? appeared first on AwardSpace.com.

]]>
Before you connect with SSH, you need to create an SSH account. You can use the How to create an SSH account guide.

You can download FireSSH from the official Firefox add-ons page:
https://addons.mozilla.org/en-US/firefox/addon/firessh/

Once FireSSH is installed on your Firefox browser, you can open FireSSH from the Menu Bar -> Tools -> Web Developer -> FireSSH:

FireSSH

Open it and then enter your SSH details:
SSH host: yourdomain.com (use any hostname that is correctly hosted in your Control Panel -> Website Manager -> Domain Manager section)
Port: 2222 (the default SSH port 22 is not supported, so make sure you use 2222)
Login: Your SSH username (the SSH username is the same as your client ID)
Password: Your SSH password (the password you submitted, when you created your SSH account)

FireSSH-2

You should now be successfully connected!

The post How to connect through SSH using FireSSH? appeared first on AwardSpace.com.

]]>
How to use mod_rewrite (RewriteRule/RewriteCond) https://www.awardspace.com/kb/mod-rewrite/ Wed, 20 Sep 2017 13:11:56 +0000 https://www.awardspace.com/?page_id=13341 In this tutorial, we are going to walk you through the process of enabling mod_rewrite on your AwardSpace web server.   What is Mod_Rewrite? Mod_rewrite is an Apache module that helps you perform redirects and define rewrite rules with the use of a .htaccess file. For more detailed information, please visit the official Apache Module […]

The post How to use mod_rewrite (RewriteRule/RewriteCond) appeared first on AwardSpace.com.

]]>
In this tutorial, we are going to walk you through the process of enabling mod_rewrite on your AwardSpace web server.

 

What is Mod_Rewrite?

Mod_rewrite is an Apache module that helps you perform redirects and define rewrite rules with the use of a .htaccess file.

For more detailed information, please visit the official Apache Module mod_rewrite page.

 

How Can I Enable the Apache Rewrite Module on a Shared Hosting Account?

The Apache module mod_rewrite comes preinstalled with all shared hosting plans. Therefore, you will not be required to perform any manual installation of the module on the server.

In order to enable the rewrite module on your website, make sure that your .htaccess contains the following two lines of code:

  RewriteEngine On
  RewriteBase /

 

At the end, your code should look similar to the following:

  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]

 

Note: If you have installed your application in a subdirectory of your domain name (domain.com/site/ for example), it will be necessary to make a couple of slight modifications to the code:

  RewriteEngine On
  RewriteBase /site/
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /site/index.php [L]

 

Please make sure that you replace site with your actual directory name.

 

How Can I Enable the Rewrite Module on a VPS Server?

On a Debian/Ubuntu server, the Apache rewrite module is installed, but not enabled by default.

If you have an active VPS account and wish to enable mod_rewrite on your web server, you should perform the following steps:

 

1. Log into your VPS account via SSH and execute the following command in Terminal:

  a2enmod rewrite

 

2. Restart the Apache web server:

  /etc/init.d/apache2 restart

 

3. Locate the main .htaccess file in your web application’s root directory, and then copy and paste the below code into it:

  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]

 

Save the changes you have just made and re-test your application.

The post How to use mod_rewrite (RewriteRule/RewriteCond) appeared first on AwardSpace.com.

]]>
How to extract archive files? https://www.awardspace.com/kb/extract-archive-files/ Tue, 12 Sep 2017 16:35:58 +0000 https://www.awardspace.com/?page_id=12887 Extracting archive files can be accomplished in many ways, below you can find a few of them. File Manager In the Control Panel -> Hosting Tools -> Website Manager -> “File Manager” there is an “Extract” button that automatically detects the file type of the archive and extracts the file in the directory, where it […]

The post How to extract archive files? appeared first on AwardSpace.com.

]]>
Extracting archive files can be accomplished in many ways, below you can find a few of them.

File Manager
In the Control Panel -> Hosting Tools -> Website Manager -> “File Manager” there is an “Extract” button that automatically detects the file type of the archive and extracts the file in the directory, where it is located.

SSH
Before you connect with SSH, you need to create an SSH account. You can use the How to create an SSH account guide.
The SSH method requires you to first successfully connect through SSH (You can use the How to connect through SSH? guide) and then you can execute the following commands depending on the type of your archive file:

To extract a zipped file use this command:
unzip YOUR_ARCHIVE.zip

To extract a .rar file use this command:
unrar -x YOUR_ARCHIVE.rar

To extract an uncompressed tarball use this command:
tar -xvf YOUR_ARCHIVE.tar

To extract gzipped tarball use this command:
tar -xvfz YOUR_ARCHIVE.tar.gz

To extract bzipped tarball use this command:
tar -xvfj YOUR_ARCHIVE.tar.bz2

Make sure you replace YOUR_ARCHIVE with the name of your archive file.

PHP
Another solution for extracting different archives is through a PHP script. To do this, first, you need to create a PHP file inside the directory where the archive file is currently stored in your account and then you need to add the appropriate code inside the PHP file, depending on the archive type.

To extract a zip file, you need to create a PHP file with the following content:
<?php
$zip = new ZipArchive;
$zip->open('YOUR_ARCHIVE.zip');
$zip->extractTo('./');
$zip->close();
echo "OK!";
?>

To extract a tar file, you need to create a PHP file with the following content:
<?php
try {
$phar = new PharData('YOUR_ARCHIVE.tar');
$phar->extractTo('./');
echo ('File extracted');
} catch (Exception $e) {
}
echo ('OK!')
?>

Make sure you replace YOUR_ARCHIVE with the name of your archive file.

The post How to extract archive files? appeared first on AwardSpace.com.

]]>