.htaccess redirect url without trailing slashes
Try either
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]
or
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]
The $
character tells Apache that this is the end of string and no more characters are expected. So you'll have to notify it to accept the slash at the end of the string, or to just be ready for any extra characters. You can use the ?
flag to make the trailing slash not required, but accepted if present, e.g.:
RewriteRule ^first-page(/)?$ /subdir/page.php?id_page=1 [QSA,L]
So this won't let any other characters other than slash.
Hope this helps.