Jump to content

.htaccess is not transferring the second and third dynamic parameters


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.