php - rewrite url based on specific sub-directory using.htaccess -
i wondering whether it's possible use .htaccess search particular folder starts number , redirects internally without changing url in browser.
lets have url like:
www.example.com/api/rest/3.22/user
now want rewrite url internally (for example)
www.example.com/api/rest/3.0/user
note: 3.0 folder available in server , 3.22 name.
i tried following one,but not helps.
rewriterule ^api/rest/3\.22/$ /api/rest/3.0/$1
try rule in root .htaccess:
rewriterule ^(api/rest)/(?!3\.0/)[\d.]+/(\w+)$ /$1/3.0/$2 [l,nc]
Comments
Post a Comment