.htaccess - htaccess similar file names goes to same page -


most of rewriterules working fine there couple have same word in them , aren't going correct page.

here full htaccess

options +followsymlinks   rewriteengine on  rewritecond %{script_filename} !-f rewritecond %{script_filename} !-d  # rewrites main pages rewriterule home index.php rewriterule about-us about-us.php rewriterule business-advice business-advice.php  rewriterule associates associates.php rewriterule become-an-associate associates-sign-up.php rewriterule blog blog.php rewriterule contact-us contact-us.php rewriterule log-in log-in.php rewriterule sign-up sign-up.php 

the problem resides within 2 associated links. when go [myurl]/associates works fine if go [myurl]/become-an-associate takes me correct url shows content [myurl]/associates

anybody got ideas? thanks,

the pattern rewriterule's regular expressions , rules loop until uri stops changing. means first time around, when request /become-an-associate, matches , rewritten /associates-sign-up.php. then, second time around, rule pattern associates matches because of "/associates-sign-up.php". need add boundary checks (e.g. ^ , $) [l] flag:

# rewrites main pages rewriterule ^home/?$ index.php [l] rewriterule ^about-us/?$ about-us.php [l] rewriterule ^business-advice/?$ business-advice.php  [l] rewriterule ^associates/?$ associates.php [l] rewriterule ^become-an-associate/?$ associates-sign-up.php [l] rewriterule ^blog/?$ blog.php [l] rewriterule ^contact-us/?$ contact-us.php [l] rewriterule ^log-in/?$ log-in.php [l] rewriterule ^sign-up/?$ sign-up.php [l] 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -