.htaccess is a configuration file used by the Apache webserver to control various aspects of a website's behavior. It is a powerful tool that allows you to make changes to the server's configuration without having to modify the main server configuration file, which is usually located in the /etc/httpd directory.
Basically, We use htaccess for SEO-friendly URLs. Besides, we use htaccess to define various rules. By default, htaccess does not enable in apache2 config. For this reason, htaccess does not work on the server.
Goto Apache folder and search apache2.conf file
Open With Terminal
sudo nano apache2.conf
Change AllowOverride None To AllowOverride All
sudo service apache2 restart
Now see it working
Get the latest news and updates by signing up to our daily newsletter.We won't sell your email or spam you !