htaccess optimization
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]
精彩评论