LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > htaccess parsing

Reply
 
Thread Tools Display Modes
  #1  
Old 05-13-2011, 11:44 AM
Chmava Chmava is offline
Member
 
Join Date: May 2011
Posts: 14
Exclamation htaccess parsing

Hi,

i have a bit of an issue with .htaccess using litespeed.

for example:

RewriteRule ^examples/(.*)$ example.html?id=$1 [QSA,L]
RewriteRule ^examples$ example.html [QSA,L]

RewriteRule ^([a-z0-9\-\/]+)(\.p([0-9]+))?\.(htm|html)$ example.php?url=$1&p=$3 [QSA,L]

would not work on litespeed but work fine on apache.

the thing about this 2 query is the first one change the url in question to a "example.html?id=something" for the second one to turn it into "example.php?url=examples&p=".

is this function supported in litespeed somewhere or somehow?

as it is required to, even if it's slightly inefficient.

Best Regards

Last edited by Chmava; 05-13-2011 at 11:56 AM..
Reply With Quote
  #2  
Old 05-13-2011, 04:21 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
you can turn on Rewrite logging (admin console -> vhost -> rewrite) and set log level to 9 (highest) to see where is wrong.

my test on these rewriterules are good.
Quote:
2011-05-13 19:26:26.446 [INFO] [xxx.xxx.xxx.xxx:49299-0#Example] [REWRITE] Rule: Match 'examples/abc' with pattern '^examples/(.*)$', result: 2
2011-05-13 19:26:26.446 [INFO] [xxx.xxx.xxx.xxx:49299-0#Example] [REWRITE] Source URI: 'examples/abc' => Result URI: 'example.html?id=abc'
2011-05-13 19:26:26.446 [INFO] [xxx.xxx.xxx.xxx:49299-0#Example] [REWRITE] append query string 'id=abc'
2011-05-13 19:26:26.446 [INFO] [xxx.xxx.xxx.xxx:49299-0#Example] [REWRITE] Last Rule, stop!
Quote:
2011-05-13 19:24:19.314 [INFO] [xxx.xxx.xxx.xxx:49275-0#Example] [REWRITE] Rule: Match 'examples.html' with pattern '^examples/(.*)$', result: -1
2011-05-13 19:24:19.314 [INFO] [xxx.xxx.xxx.xxx:49275-0#Example] [REWRITE] Rule: Match 'examples.html' with pattern '^examples$', result: -1
2011-05-13 19:24:19.314 [INFO] [xxx.xxx.xxx.xxx:49275-0#Example] [REWRITE] Rule: Match 'examples.html' with pattern '^([a-z0-9\-\/]+)(\.p([0-9]+))?\.(htm|html)$', result: 5
2011-05-13 19:24:19.314 [INFO] [xxx.xxx.xxx.xxx:49275-0#Example] [REWRITE] Source URI: 'examples.html' => Result URI: 'example.php?url=examples&p='
2011-05-13 19:24:19.314 [INFO] [xxx.xxx.xxx.xxx:49275-0#Example] [REWRITE] append query string 'url=examples&p='
2011-05-13 19:24:19.314 [INFO] [xxx.xxx.xxx.xxx:49275-0#Example] [REWRITE] Last Rule, stop!

Last edited by webizen; 05-13-2011 at 04:27 PM..
Reply With Quote
  #3  
Old 05-14-2011, 01:05 AM
Chmava Chmava is offline
Member
 
Join Date: May 2011
Posts: 14
Hi,

it seem a htaccess of 100 line or so long take up to 4 second to prase..... even on litespeed....

we removed all but 10 important line, and it load on avg 4 seconds faster...

we added [QSA,L,E=cache-control:max-age=65535], not much inprovement.

we saw a way to cache it in litespeed itself, but could not find an option anywhere?

Any help on this will be very grateful!

Also we are not using a virtual host for the site, as it's not a shared environment?

Best Regards

Last edited by Chmava; 05-14-2011 at 01:18 AM..
Reply With Quote
  #4  
Old 05-14-2011, 01:11 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
please refer
http://blog.litespeedtech.com/2011/0...uilt-in-cache/
for an example to enable cache

also there is a "LiteSpeed Cache" subforum:
http://www.litespeedtech.com/support...splay.php?f=30
Reply With Quote
  #5  
Old 05-14-2011, 01:19 AM
Chmava Chmava is offline
Member
 
Join Date: May 2011
Posts: 14
Hi,

We are not using a virtual host for the site?
is there a benefit to putting it under virtual host?

Best Regard
Reply With Quote
  #6  
Old 05-14-2011, 01:26 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
if you're using apache http.conf, that's ok too.
Reply With Quote
  #7  
Old 05-14-2011, 01:44 AM
Chmava Chmava is offline
Member
 
Join Date: May 2011
Posts: 14
Hi,

any idea why does this not work?

RewriteRule ^example/?(.*)/?(.*)/?(.*)$ example.php?id=$1&ud=$2&ed=$3 [QSA,L,E=cache-control:max-age=65535]

Best Reagrds
Reply With Quote
  #8  
Old 05-14-2011, 02:09 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
cache need 2-CPU or above license.

what's your test URL, and the reason you're sure not working?
Reply With Quote
  #9  
Old 05-14-2011, 02:17 AM
Chmava Chmava is offline
Member
 
Join Date: May 2011
Posts: 14
Hi,

it does not seem to phrase pass the first "(*)" ?

and error log in cpanel does not show any issue?

Best Regards
Reply With Quote
  #10  
Old 05-16-2011, 01:10 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
everything is covered by the first "(.*)". this is the case in both lsws and apache.

try
Quote:
RewriteRule ^example/?([^/]*)/?([^/]*)/?([^/]*)$ example.php?id=$1&ud=$2&ed=$3 [QSA,L,E=cache-control:max-age=65535]

Last edited by webizen; 05-16-2011 at 01:27 PM..
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:07 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.