ansharma Posted April 16, 2012 Share Posted April 16, 2012 Hi all i wrote an .htaccess file for my website, for clean urls but it works only for first dynamic parameter and skips other ones. my code is RewriteRule (.*)~(.*) /detail.php?city_name=$1&prop_url=$2 [NC] RewriteRule (.*)-flats /all.php?city_name=$1 [NC] RewriteRule (.*)-flats-(.*) /all.php?city_name=$1&status=$2 [NC] RewriteRule (.*)-flats-page-(.*) /all.php?city_name=$1&page=$2 [NC] RewriteRule (.*)-flats-(.*)-page-(.*) /all.php?city_name=$1&status=$2&page=$3 [NC] RewriteRule services\.html /services.php [NC] RewriteRule contact_us\.html /contact_us.php [NC] RewriteRule about_us\.html /about_us.php [NC] RewriteRule blog/(.*) /blog/(.*) [NC] Quote Link to comment https://forums.phpfreaks.com/topic/261024-htaccess-is-not-transferring-the-second-and-third-dynamic-parameters/ Share on other sites More sharing options...
AyKay47 Posted April 16, 2012 Share Posted April 16, 2012 the top 5 rules might be rewritten several time unexpectedly. Be careful when using the dot meta-character in rewrite rules, as it matches any character. I'll give you a hint, you will want to use the ^$ meta-characters to distinguish the beginning and end of the pattern. Quote Link to comment https://forums.phpfreaks.com/topic/261024-htaccess-is-not-transferring-the-second-and-third-dynamic-parameters/#findComment-1337787 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.