• Services
    • Web Hosting
    • Reseller Hosting
    • VPS Hosting
    • Dedicated Hosting
  • Domains
  • Features
  • Company
    • About Us
    • Server Locations
    • Affiliates
    • Company Blog
  • Support
  • Client Login
  • Services
    • Web Hosting
    • Reseller Hosting
    • VPS Hosting
    • Dedicated Hosting
  • Domains
  • Features
  • Company
    • About Us
    • Server Locations
    • Affiliates
    • Company Blog
  • Support
  • Client Login
Home/Article/Web Hosting/.htaccess/How to create 301 redirection using .htaccess

How to create 301 redirection using .htaccess

Written by VernalWeb
August 10, 2017

.htaccess is a configuration file to use on Apache Web Servers. Whenever a directory contains a .htaccess file, Apache Web Server loads & execute configurations written on the .htaccess. These .htaccess files can be used to bypass or alter configurations loaded by the Apache Web Server to enable/disable additional functionalities offered by Apache Web Server. Here we’re to learn how to create 301 redirection using .htaccess.

How to create 301 redirection using .htaccess

STEP 1: Login to your cPanel Account.

cPanel Login Interface

STEP 2:Search for ‘File Manage’ under ‘Files’ section. Click on it

cPanel File Manager

STEP 3: Browse ‘public_html’ folder & search for .htaccess file. Enable hidden file browsing if you can’t find a .htaccess file.

STEP 4: Right click on ‘.htaccess’ file & click on ‘Edit’.

edit .htaccess

STEP 5: A prompt window will show up. Click on ‘Edit’.

Start editing

STEP 6: Write the Following Commands in your .htaccess file

Options +FollowSymLinks
RewriteEngine on
Redirect 301 /file1.php /https://www.yourwebsite.com/file2.php

This will permanently redirect file1.php to file2.php. So both your visitors & search engine crawler bots will be redirected to file2.php once you’ve implemented this code in your .htaccess.

Note:  If the following lines are already in your .htaccess file don’t write them again.

Options +FollowSymLinks
RewriteEngine on

We hope this tutorial helps you find the perfect solution. If your like our tutorials, definitely you’ll love our support. All VernalWeb hosting plans include 24/7 support from our amazing inhouse support staff. Check out our web hosting plans and have your website migrated today!

Tags:htaccess

Was this helpful?

Yes  No
Related Articles
  • How to create or edit .htaccess file in cPanel
  • How to Redirect HTTP Requests to HTTPS with .htaccess
  • How to enable hotlink protection using .htaccess Code
  • How to create custom 404 page using .htaccess
  • How to Create SEO Friendly URL Using .htaccess
  • How to force SSL using .htaccess file

Didn't find your answer? Submit Ticket

Latest Articles

  • How to show Hidden Files (.htaccess) in cPanel File Manager
  • Setup a Domain Redirection in cPanel
  • Create a MySQL Database and a User from cPanel
  • Remove page extensions using .htaccess
  • Cron Job Usage & Policy
  • © 2014 - 2025 VernalWeb. All rights reserved.