mod_rewrite module is enabled by default on CentOS 7. If you find it is not enabled on your server, you can enable it by editing
00-base.conf file located in
Add or uncomment the following line:
Save and close the file, then restart the httpd service:
mod_rewrite module has been activated, you can set up your URL rewrites by creating an
.htaccess file in your default document root directory. A
.htaccess file allows us to modify our rewrite rules without accessing server configuration files. For this reason,
.htaccess is critical to your web server. Before we begin, we need to allow Apache to read
.htaccess files located under the
You can do this by editing
Find the section
AllowOverride None to
Save and exit.
Now restart Apache to put the change into effect:
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.
I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.