regex - Regular Expression for Mod rewrite via HTACCESS -
i need regular expression can use in htaccess file rewrite:
http://www.sample.com/dir/1-2-3.php
1 = lower case letters only, no limit on how many
2 = alpha numeric (lower case letters only) , dashes, no limit on how many characters
3 = alpha numeric (upper case letters only), no limit on how many characters
(note: dashes between 1, 2, 3 intentional, , present in url)
to
http://www.sample.com/dir/sub/page.php?v=abc12345
where abc12345 #3 original url.
if i'm understanding correctly, following should work.
rewriteengine on rewriterule ^([a-z]*)-([a-z0-9-]*)-([a-z0-9]*)\.php /$1/$2.php?v=$3 [l] hope helps.
Comments
Post a Comment