.htaccess randomly not being loaded

#1
We have an issue with Litespeed not always loading our root .htaccess file.

When the .htaccess doesn't load, it looks in the root folder for the files, when infact they're in /folder/, there is a error.html in the root, which loads when .htaccess fails. This has caused 260,000 error.html pages today alone.

A simple refresh fixes the issue, but obviously it's still a huge problem.

I've opened a ticket but yet to receive a reply, so figured I'd ask on here.

Do any of you know why litespeed might randomly decide not to load the .htaccess file?

Many thanks in advance.

Paul
 

mistwang

LiteSpeed Staff
#2
Yes, you should use this forum for your free support.

Which version of LSWS are you using? You should upgrade to latest.
What in the .htaccess that tell web server to look for a file in /folder/ ?
give us an example, URL, and location of file. You can mask the domain.
Is there a sub-domain involved?
 
#3
Hey mistwang,

We do have the latest version installed.

Basically we use a forum software as our CMS. But not all of the URLs are /forum/ related.

So we have a .htaccess in the top level, so that we can rewrite URLs to the root. So rather than /forum/folder/index.html it would simply be /folder/index.html

The URL's are actually dynamic not static. When .htaccess fails, it loads error.html from the root. I can reproduce the error by temp renaming the .htaccess in root.

An example: RewriteRule ^notifications/my-notifications.html /forum/index.php?autocom=themes&code=notifications [L]

I hope that makes more sense now. I'm not the programmer btw, I just own the company and trying to find a resolve.
 

mistwang

LiteSpeed Staff
#4
Since it is a rewrite rule, you can enable Rewrite Logging by set RewriteLogLevel 9 for that vhost. If httpd.conf is used, you need to add that the <VirtualHost >
restart LSWS. then reproduce the error, check error log for related log entries.
Grep the log file by your IP should easily locate those log entires.

Load firebug in firefox when you do the test, you can locate URL with 404 response and match it with the log.
 
#6
Quick update

We are also finding stuff like this in our LS logs:

["APVH_Default"] 94.189.178.244 - - [26/Feb/2010:13:40:57 -0500] "GET /favicon.ico HTTP/1.1" 404 389 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)"

This DOES exist. No htaccess or rewrites involved.

It's also happening on many random files. Does that help or just make matters more confusing?
 

mistwang

LiteSpeed Staff
#9
That request is handled by the default vhost at /usr/local/apache/htdocs/ , because domain name in the URL is not any vhost configured, so it is handled by the default vhost. maybe the server IP address is used in the URL.
 
#10
Ok thanks, host says they've fixed that.

We also have a random duplicate upload issue, that is present under litespeed but not apache.

Users upload a file, say a wallpaper, and it's inserted in to the database several times creating multiple instances in the gallery.

Under apache, despite slightly higher load, it doesn't happen.

Cheers
 
Top