Mobile app version of vmapp.org
Login or Join
Merenda212

: 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

@Merenda212

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.

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Merenda212

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme