random 404 on mod_rewrite

piper

Well-Known Member
#1
Hi,

I Run a wordpress site with mod_rewrite and it's installed on the root folder

in subfolder i have a forum application and it has it's own htaccess for mod_rewrite

It works but randomly gives 404 on the forum

This is what the server have

Litespeed Enterprise 3.11, PHP 5.2.2, LSPHP 4.0

Htaccess is

RewriteEngine On
RewriteRule ^index\.html$ ./index.php?mdrw=on
RewriteRule ^manual\.html$ ./index.php?action=manual&mdrw=on
RewriteRule ^([0-9]+)_([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vthread&forum=$1&topic=$2&page=$3&mdrw=on
RewriteRule ^([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vtopic&forum=$1&page=$2&mdrw=on


Any help?

Thanks in advanced
 

mistwang

LiteSpeed Staff
#2
Are there rewrite rules in .htaccess of the root folder?

Random error is hard to debug, and we need at least some debug log for request results in 404, with rewrite log enabled, in order to look it further. It might have something to do with htaccess cache updating.
Is that possible to generate some debug log for analysis?

One possible fix is to create a static context for the forum, and move the rewrite rule from .htaccess to the context level configuration, without changing the rewrite rules. But, if the random 404 is cause by a bug in htaccess handle, the bug will remain there.
 

piper

Well-Known Member
#3
i got this error

[config:vhost:gear:context:/forums/] rewrite: invalid third parameter, '[' is expected while parsing: RewriteRule ^([0-9]+)_([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vthread&forum=$1&topic=$2&page=$3 &mdrw=on
 

piper

Well-Known Member
#4
Can you guide me on how to make static context?

the forum folder is at /home/user/gear/forums

goes to /forums/

(i tried creating static but dont know about the setting)

Thanks
 

mistwang

LiteSpeed Staff
#5
i got this error

[config:vhost:gear:context:/forums/] rewrite: invalid third parameter, '[' is expected while parsing: RewriteRule ^([0-9]+)_([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vthread&forum=$1&topic=$2&page=$3 &mdrw=on
There is a space in between "...&page=$3 &mdrw=on".
 

piper

Well-Known Member
#7
hmm i'm not sure since it only happend randomly, if i refresh the page after 404 it shows up fine

can you guide me on how to create static context with the mod_rewrite rule? i still dont get how it works :p
 

mistwang

LiteSpeed Staff
#9
If you are using LiteSpeed + hosting control panel, you maybe not able to add static context, as the site is configured through Apache httpd.conf. It will need your assist if it is caused by a bug.

How often does it happen?
 

piper

Well-Known Member
#10
every 20-30 clicks on different url of the mod_rewrite

i'm ready to assist :)

the forum is located here

http://www.myitablet.com/talk/

to reproduce just surf around the forum (browsing forum categories and forum topics back and forth) after 20-30 clicks it will give 404 error
 
Last edited:

mistwang

LiteSpeed Staff
#11
First, you need to set "RewriteLogLevel 9" to turn on rewrite log for that vhost.
Next, clicking "Enable debug logging" from LSWS control panel, to turn on debug logging, click again will turn it off.
Go to your site and click around, until you produce a few 404 pages, turn dbug logging off. then send lsws/logs/error.log to bug ((a)) litespeedtech ((.)) com.
 

pguy

Active Member
#15
A similar problem here, a ton of 404s on wordpress. I am trying out the enterprise version. How can I best update to 3.1.2, which is linked about but not listed in the downloads? I am currently using 3.1.1

Thanks
 
Top