IPB .htaccess Furls and Litespeed Cache

#1
Hey folks,

I followed this tutorial to the letter for our IPB Board.
http://litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:litespeed:cache:ipboard

This is a big board and we thought we had the .htaccess fine tuned for the forums but it appears not. Seemed when we setup the IPB SE Friendly URLs .htaccess rule with the litespeed .htaccess rule and some visitors started reciecing infinite redirect notices using mobiles and google translator. Upon inspection it appears we failed at the rule rewrite mod for IPB and LS Cache.

Please help me with this if you can:

Litespeed rule:
RewriteEngine On
###########################################
# For LiteSpeed public cache (guest user)
###########################################
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{HTTP_COOKIE} !member_id= [OR]
RewriteCond %{HTTP_COOKIE} member_id=0
RewriteCond %{REQUEST_URI} !^/admin
RewriteCond %{REQUEST_URI} !(css|js|png|gif)$
RewriteCond %{QUERY_STRING} ^$
RewriteRule .* – [E=Cache-Control:max-age=360]

IPB SEO Rule:
Options -MultiViews
RewriteEngine On
RewriteBase /forums/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /forums/index.php [L]
 

webizen

Well-Known Member
#2
You may try the following rules:
%
Options -MultiViews
RewriteEngine On
RewriteBase /forums/
###########################################
# For LiteSpeed public cache (guest user)
###########################################
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{HTTP_COOKIE} !member_id= [OR]
RewriteCond %{HTTP_COOKIE} member_id=0
RewriteCond %{REQUEST_URI} !^/forums/admin
RewriteCond %{REQUEST_URI} !(css|js|png|gif)$
#RewriteCond %{QUERY_STRING} ^$
RewriteRule .* – [E=Cache-Control:max-age=360]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /forums/index.php [L]
Make sure to put non-cacheable URLs in Do-Not-Cache box.

Also enable rewrite logging to troubleshoot.
 
#3
Thanks. Sorry the same issue occurs. This looks like what I had before.

Are you suppose to have multiple rewrites? I thought you could combine the rewrite together?
 

webizen

Well-Known Member
#4
Yes, you can have multiple rewrites. Usually LS cache rules should be put in front of other rules (that's why no 'L' for the '.* -' one). Please enable rewrite logging to troubleshoot.
 

mistwang

LiteSpeed Staff
#5
Thanks. Sorry the same issue occurs. This looks like what I had before.
I think you need to find out which URL is causing the trouble.
Maybe something should not be cached has been cached. and turn cache off for that URL.
If you can reproduce the problem, you can check it with firebug, or use tcpdump to dump the request/response related at network level.
 
Top