This is how i fixed my problem.
I used the file manager to delete the .htaccess file(You can rename it to be on the safer side). Then i went to the WordPress admin settings page and clicked on “permalinks”. There i changed the setting to default and applied the new setting. Then i changed it to the setting i wanted and applied the new setting again. It worked! What happens here is, a new .htaccess file is written and the links will start working again.