Lately i have been using a htaccess code to change my site file names from e.g. localhost/tutorials/rewrite/about.php to localhost/tutorials/rewrite/about/
As you can see i am using my xampp localhost and the htaccess file is located in the rewrite folder

The code used works well. Use request_filename to make sure its not a file or folder first and then do the busniess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ $1.php [L]

The problem is that when making a link for a page. I have changing it to
The htaccess code did work when i didnt have the first to change the .php to /

RewriteRule ^events/([^/]*)/$ events/?url=$1 [L]
But with the first rule in place my page link which should read <a href="events/event-namer-tile/"> becomes <a href="localhost/tutorials/rewrite/localhost/tutorials/rewrite/events/event-name/">

So each works on there own but breaks when brought together

Any help please