I need conditional redirection rule like below:
- Code: Select all
RewriteRule l/?([-a-zA-Z0-9_+]+)$ short/new1_rdr.php?d=$1 [L]
RewriteRule s/?([-a-zA-Z0-9_+]+)$ short/new2_rdr.php?d=$1 [L]
RewriteRule ^/?([-a-zA-Z0-9_+]+)$ short/new.php?d=$1 [L]
In above rules, what I wanted to achieve is:
1. whenever http://abc.com/l/gdff gets request it should get redirected to short/new1_rdr.php file.
2. whenever http://abc.com/s/hdvb gets request it should get redirected to short/new2_rdr.php file.
3. And if anything other than 'l or s' in the request like http://abc.com/k/hdvb, it should get redirect to short/new.php file.
Above redirection rules are not working as expected.
Please help me to solve this.