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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Bug Reports > random 404 on mod_rewrite

Reply
 
Thread Tools Display Modes
  #1  
Old 06-01-2007, 07:03 PM
piper piper is offline
Senior Member
 
Join Date: Jan 2007
Posts: 58
Default random 404 on mod_rewrite

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
Reply With Quote
  #2  
Old 06-01-2007, 09:24 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
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.
Reply With Quote
  #3  
Old 06-01-2007, 10:32 PM
piper piper is offline
Senior Member
 
Join Date: Jan 2007
Posts: 58
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
Reply With Quote
  #4  
Old 06-01-2007, 10:48 PM
piper piper is offline
Senior Member
 
Join Date: Jan 2007
Posts: 58
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
Reply With Quote
  #5  
Old 06-02-2007, 07:46 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Quote:
Originally Posted by piper View Post
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".
Reply With Quote
  #6  
Old 06-02-2007, 07:47 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Maybe 404 is caused by the error in rewrite rule? that rule does not get in.
Reply With Quote
  #7  
Old 06-02-2007, 08:55 AM
piper piper is offline
Senior Member
 
Join Date: Jan 2007
Posts: 58
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
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 08:54 PM.



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