If your .htaccess file was writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all. code example
Example: apache2 .htaccess not writable
#if only ownership issue
sudo chown www-data: .htaccess
#else correct permissions to the directory
sudo chmod -R 755 /var/www/html/yourdomainname
sudo chown -R www-data:www-data /var/www/html/yourdomainname