ayok Posted March 20, 2009 Share Posted March 20, 2009 Hi, I'm trying to make a .htacces file for a cleaner urls with rewriterule. However, I've got a problem with a variable with two values. For example: RewriteRule ^page/([0-9_-]+)-([0-9_-]+)-([0-9_-]+).html$ page/index.php?id=$1&menusOpen=$2&menuId=$3 [L] With this codes I got page/0-12-34.html, but some values of "menusOpen" variable has two or three values like menusOpen=23-24-34 or menusOpen=1-21. So, I can't open those url. I've tried RewriteRule ^page/([0-9_-]+)-([0-9_-]+)-([0-9_-]+)-([0-9_-]+).html$ page/index.php?id=$1&menusOpen=$2-$3&menuId=$4 [L] but it doesn't work. Would anyone help me with this? Thank you, ayok Quote Link to comment https://forums.phpfreaks.com/topic/150399-solved-clean-url/ Share on other sites More sharing options...
irkevin Posted March 20, 2009 Share Posted March 20, 2009 RewriteRule ^page/([0-9_-]+)-([0-9_-]+)-([0-9_-]+)-([0-9_-]+)\.html$ page/index.php?id=$1&menusOpen=$2-$3&menuId=$4 [L] try this, i added a slash .. dont garantee anything Quote Link to comment https://forums.phpfreaks.com/topic/150399-solved-clean-url/#findComment-789879 Share on other sites More sharing options...
ayok Posted March 20, 2009 Author Share Posted March 20, 2009 Thank you, but it doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/150399-solved-clean-url/#findComment-789922 Share on other sites More sharing options...
ayok Posted March 20, 2009 Author Share Posted March 20, 2009 It's solved I change RewriteRule ^page/([0-9_-]+)-([0-9_-]+)-([0-9_-]+).html into ^page/([0-9]+)-([0-9]+\-[0-9]+)-([0-9]+)\.html$ Quote Link to comment https://forums.phpfreaks.com/topic/150399-solved-clean-url/#findComment-789939 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.