Check and enable mod_rewrite if htaccess not working

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.


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.

a2enmod rewrite

You will get the response that

Enabling module rewrite.

Now restart your server and Enjoy! All done!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s