How to Enable mod_rewrite in WHM cPanel - Crown Hosting

Nov 14, 2023

Introduction

Welcome to Crown Hosting, your go-to destination for all your IT services & computer repair needs in the UK. In this article, we will guide you through the process of enabling mod_rewrite in WHM cPanel. By implementing this crucial functionality on your website, you can significantly enhance your website's SEO capabilities and improve user experience.

Understanding mod_rewrite

Mod_rewrite is a powerful module that allows you to modify the way URLs are displayed on your website. It enables you to create search engine-friendly URLs that are easier to remember, understand, and share. By using mod_rewrite, you can transform complex URLs with multiple query parameters into clean, hierarchical, and keyword-rich URLs.

Step-by-Step Guide to Enable mod_rewrite in WHM cPanel

Step 1: Log in to your WHM cPanel Account

To begin, log in to your WHM cPanel account using your credentials. Once logged in, you'll have access to a wide range of tools and settings that empower you to manage your web hosting environment efficiently.

Step 2: Locate and Access the Apache Configuration Editor

After logging into your WHM cPanel account, search for the "Apache Configuration" option. This option may vary depending on your cPanel theme, but it is usually found under the "Service Configuration" section. Click on it to access the Apache Configuration Editor.

Step 3: Modify the .htaccess File

Within the Apache Configuration Editor, locate the "Include Editor" tab. Under this tab, you will find the option to edit the .htaccess file for your website. The .htaccess file is a configuration file that allows you to override certain settings for your website without directly modifying the main server configuration file.

Step 4: Enable mod_rewrite

Within the .htaccess file, add the following code snippet to enable mod_rewrite:

RewriteEngine On RewriteRule ^(.*)$ /index.php/$1 [L]

Save the changes to the .htaccess file once you've added the code snippet.

Step 5: Test mod_rewrite

To verify if mod_rewrite is working correctly, it's recommended to test it by creating a sample URL structure and checking if it redirects as expected. This will ensure that your website is now utilizing mod_rewrite to enhance its URL structure and search engine optimization.

Conclusion

Congratulations! You have successfully enabled mod_rewrite in WHM cPanel, taking a significant step towards improving your website's SEO capabilities and user experience. Clean and keyword-rich URLs created through mod_rewrite can help search engines better understand and rank your website, resulting in increased organic traffic and improved visibility.

At Crown Hosting, we provide top-notch IT services & computer repair solutions tailored to meet your specific requirements. Trust our expertise to manage your web hosting needs, enabling you to focus on your core business objectives. Get in touch with us today to explore our comprehensive range of services!

whm cpanel enable mod_rewrite