Jump to content

.htaccess is not transferring the second and third dynamic parameters


ansharma

Recommended Posts

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]

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.