开发者

htaccess optimization

开发者 https://www.devze.com 2023-03-02 21:19 出处:网络
RewriteCond %{THE_REQUEST} \\?event_id=156&app=([a-z]+) RewriteRule ^events/(index.php)$ http://www.xyz.com/is2011/?app=%1[R=301,L]
RewriteCond %{THE_REQUEST} \?event_id=156&app=([a-z]+)
RewriteRule ^events/(index.php)$ http://www.xyz.com/is2011/?app=%1  [R=301,L]

RewriteCond %{THE_REQUEST} \?event_id=156
RewriteRule ^events/(index.php)$ http://www.xyz.com/is2011/?  [R=301,L]

I just want to optimize the h开发者_高级运维taccess code. I want to merge the above two rules. Can i do the same? Please give me your suggestions.


Just guessing:

RewriteCond %{THE_REQUEST} \?event_id=156(&(app=([a-z]+)))?
RewriteRule ^events/(index.php)$ http://www.xyz.com/is2011/?%2  [R=301,L]


Try this rule:

Options +FollowSymlinks -MultiViews
RewriteEngine on

RewriteCond %{QUERY_STRING} ^event_id=156(?:&(app=[a-z]+))? [NC]
RewriteRule ^events/index\.php$ http://www.xyz.com/is2011/?%1 [R=301,L,NC,NE,QSA]
0

精彩评论

暂无评论...
验证码 换一张
取 消