.htaccess - Double RewriteRule with htaccess -


I have a problem with my rules; I put both but only works first.

I have 2 different information files.

  RewriteRule ^ ([A-Za-z0-9 -] +) /? $ Tour.php? Tour = $ 1 [NC, L] Rematerialized Rules ^ ([AZA-J 0-9 -] +) /? $ ProgramApp? Program = $ 1 [nc, l]    

only the first thing because the matches It is exactly what you use for the match: ^ ([one-zA-Z0-9 -]? +) / $ . You should do more to isolate what to do for tour.php and what is the programa.php . Right now, if a person is in the URL address bar in http://youdomain.com/abcdefg/ , then the URI / abcdefg / is sent to your server First rule:

  RewriteRule ^ ([A-Za-z0-9 -] +) /? Tour.php? Tour = $ 1 [nc, l]   

mail because / abcdefg / your pattern ^ ([A-Za-z0-9 -] + ) /? $ and match it to /tour.php?tour=abcdefg . If he was for programa.php ? The second rule will never be carried out, because everything has been captured from the pattern of the first rule. You have to add some more difference between the two. For example, add extra path notes:

  rewrite rule / tour / ([A-Za-z0-9 -] +) /? $ Tour.php? Tour = $ 1 [NC, L] Rules for Rebate ^ Program / ([A-Za-z0-9 -] +) /? $ Programa.php? Program = $ 1 [nc, l]   

This means that if I http://youdomain.com/programa/abcdefg/ , my request < Code> /programa.php?programa=abcdefg and if I write to http: //youdomain.com/tour/abcdefg/ , my request will be / Tour.php? Tour = abcdefg .

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -