2011-05-06 44 views
0
RewriteEngine on 

# if the following conditions are met, SKIP the rewriteRules. 
RewriteCond %{THE_REQUEST} \?abc=xyz(&(app=([a-z]+))) #i don't know it is right or wrong 

########LOGIN######## 
RewriteCond %{THE_REQUEST} \?event_id=156&rp=([a-zA-Z0-9=]+) 
RewriteRule ^events/login.php$ http://www.xyz.com/is2011/login.php?rp=%1 [R=301,L] 

########SEARCH########SEARCH######################## 
RewriteCond %{THE_REQUEST} \?search=([a-z]+)&event_id=156&submit=Search 
RewriteRule ^is2011/([a-z]+).php$ http://www.xyz.com/is2011/$1.php?search=%1 [R=301,L] 

我只是想跳过上面的重写规则当且仅当在查询字符串中有app = xyz。简单的Htaccess问题

+0

你能解释一下你正在试图完成什么吗? – IAmTimCorey 2011-05-06 06:53:14

+0

嗨比格斯,我编辑了这个问题。请检查一致。我只想跳过一些特定条件的重写规则。条件是每当浏览器在地址栏中找到app = xyz时。它只是跳过重写规则 – munjal 2011-05-06 07:10:04

回答

0

是:

RewriteEngine on 

# if the following conditions are met, SKIP the rewriteRules. 
RewriteCond %{THE_REQUEST} \?abc=xyz(&(app=([a-z]+))) #i don't know it is right or wrong 
RewriteRule ^(.*)$ - [skip=2] 

########LOGIN######## 
RewriteCond %{THE_REQUEST} \?event_id=156&rp=([a-zA-Z0-9=]+) 
RewriteRule ^events/login.php$ http://www.xyz.com/is2011/login.php?rp=%1 [R=301,L] 

########SEARCH########SEARCH######################## 
RewriteCond %{THE_REQUEST} \?search=([a-z]+)&event_id=156&submit=Search 
RewriteRule ^is2011/([a-z]+).php$ http://www.xyz.com/is2011/$1.php?search=%1 [R=301,L] 

重写规则,我增加不会使通过它的RewriteCond匹配的查询字符串替换任何。跳过标志跳过下一个num规则,在这种情况下是两个。请参阅http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule上的RewriteRule指令文档。

+0

thanro roirodriguez。这个对我有用 :) – munjal 2011-05-06 12:22:36