By default, Ubuntu’s Apache will ignore the directives in your .htaccess files.
To enable mod rewrite use
a2enmod rewrite on ubuntu.
Now, If you do have access to the main configuration file, You probably should NOT use htacccess files. Having said that, its still always good to learn how to do so.
the enable the htaccess files usage, we need to go to the /etc/apache2/sites-available/default file, and change the AllowOverride directive from none to All.
You then have to restart your server (apache2ctl restart) for the changes to take place.
Now you can use an htaccess file to check that you task is complete. I have written a simple htaccess file accompanied by two other files, index.html and index.php. The normal Apache behavior is to use the html first. So, you can put these files in a folder and see what you get when you enter the folder.
Then, you can change the file order in the htaccess file, which should change the file you are getting when you enter that directory.