Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
litespeed_wiki:troubleshooting:rewrite_difference_on_l_flag_between_lsws_and_apache [2019/01/03 20:29]
Jackson Zhang
litespeed_wiki:troubleshooting:rewrite_difference_on_l_flag_between_lsws_and_apache [2019/01/03 20:39]
Jackson Zhang
Line 41: Line 41:
   RewriteRule ^([^\.]+)$ $1.php [NC,​L] ​   ​   RewriteRule ^([^\.]+)$ $1.php [NC,​L] ​   ​
  
-==== Example 2: use ''<​IfModule litespeed>​ ... </​IfModule>''​ for different rules==== ​+==== Example 2: modify the rules to use only one [L] instead of multi [L]s ==== 
 + 
 +For example:  
 + 
 +  RewriteEngine On 
 +  RewriteBase / 
 +  RewriteRule ^es/(.*)$ /$1 [L] 
 +  RewriteRule ^reservar\.html(.*)$ reservar.php [L] 
 +   
 +For Apache, it will: 
 +  1- A visitor hits the URL ''​http://​example.com/​es/​reservar.html''​ . 
 +  2- The web server should recognize the pattern ^es/(.*)$ from the first rewrite rule and the request should be internally redirected to /​reservar.html. 
 +  3- /​reservar.html also matches the rule ^reservar\.html(.*)$ and should be properly redirected to reservar.php. 
 +  4- The content of this latest file should be sent to the visitor. 
 + 
 +For LSWS, it will stop at first [L] ''​RewriteRule ^es/(.*)$ /$1 [L]''​ and doesn'​t processs the forth line at all. 
 + 
 +You can make the rules reworking as the following by using only one [L] instead of multi [L]s to work with LSWS: 
 + 
 +  RewriteEngine On 
 +  RewriteBase / 
 +  RewriteRule ^es/(.*)$ /es/$1 [NC] 
 +  RewriteRule ^/​es/​reservar.html(.*)$ reservar.php [L] 
 + 
 +==== Example 3: use ''<​IfModule litespeed>​ ... </​IfModule>''​ for different rules==== ​
 For example: For example:
  
Line 112: Line 136:
   </​IfModule>​   </​IfModule>​
  
-==== Example ​3: use ''<​IfModule litespeed>​ ... </​IfModule>''​ for different blocks==== ​  +==== Example ​4: use ''<​IfModule litespeed>​ ... </​IfModule>''​ for different blocks==== ​  
 Another example is: Another example is:
   RewriteEngine On   RewriteEngine On
  • Admin
  • Last modified: 2019/03/19 15:32
  • by Lisa Clarke