|
|

05-13-2011, 11:44 AM
|
|
Member
|
|
Join Date: May 2011
Posts: 14
|
|
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..
|

05-13-2011, 04:21 PM
|
|
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..
|

05-14-2011, 01:05 AM
|
|
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..
|

05-14-2011, 01:11 AM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,216
|
|
|
|

05-14-2011, 01:19 AM
|
|
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
|

05-14-2011, 01:26 AM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,216
|
|
|
if you're using apache http.conf, that's ok too.
|

05-14-2011, 01:44 AM
|
|
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
|

05-14-2011, 02:09 AM
|
|
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?
|

05-14-2011, 02:17 AM
|
|
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
|

05-16-2011, 01:10 PM
|
|
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..
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 09:07 PM.
|
|