In my htaccess I have some rewrited urls like these:
RewriteRule ^first-page$ /subdir/page.php?id_page=1 [QSA,L]
RewriteRule ^second-page$ /subdir/page.php?id_page=2 [QSA,L]
RewriteRule ^third-page$ /subdir/page.php?id_page=161 [QSA,L]
So the final result is: www.mywebsite.com/subdir/first-page
Now I would like to turn this into www.mywebsite.com/subdir/first-page/
Without the www.mywebsite.com/subdir/first-page
giving a 404 error.
I tried this code after the url rewrites, but did not work:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ $1/ [L,R=301]
Any suggestions? Thank you so much.