So, I faced this issue, ny htaccess was not working and my API was pathetically useless because of this.
So I decided to check this with my server.
Create a PHP file on the Apache server. Write the below code inside it.
<?php phpinfo(); ?>
Now call the file in your browser (This means, put the file URL in the browser and press ENTER).
Once done, you will see info about your php. Press Ctrl+F and search for “mod_rewrite”.
If present, then please do not read any further as your issue is then different from mine.
Since you haven’t found mod_rewrite, let us proceed.
Go to your server. Run this command.
You will get the response that
Enabling module rewrite.
Now restart your server and Enjoy! All done!