bigheadedd Posted July 27, 2012 Share Posted July 27, 2012 Hi, Wondering if this is possible at all. I'm using htaccess to rewrite my pages, and i'm using the following line: RewriteRule ^([a-zA-Z0-9^-]+)$ page.php?page=$1 to rewrite it into clean links. page.php then calls the data appropriately. I am wondering though if its possible, that if the variable is 3 characters long it redirects to another page. RewriteRule ^([a-zA-Z0-9^-]+{3})$ small.php?char=$1 Something similar the above? Is that possible? I just stuck the {3} for illustration purposes. For example if my address was www.example.com/abc, it would redirect to small.php?char=abc and if it was any longer it would redirect to the page.php address. Thanks in advance, E Quote Link to comment https://forums.phpfreaks.com/topic/266340-redirect-length-of-string/ Share on other sites More sharing options...
xyph Posted July 27, 2012 Share Posted July 27, 2012 Put the 3 character one first. Remove the + from it. Quote Link to comment https://forums.phpfreaks.com/topic/266340-redirect-length-of-string/#findComment-1364913 Share on other sites More sharing options...
bigheadedd Posted July 27, 2012 Author Share Posted July 27, 2012 Ah perfect! Thanks for this. Quote Link to comment https://forums.phpfreaks.com/topic/266340-redirect-length-of-string/#findComment-1364915 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.