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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > [Resolved] Lightspeed and hosting provider - Fails

Reply
 
Thread Tools Display Modes
  #1  
Old 05-20-2010, 06:52 PM
Morpheus Morpheus is offline
New Member
 
Join Date: May 2010
Posts: 8
Default [Resolved] Lightspeed and hosting provider - Fails

All of the sudden my website started failing to display items and after tinkering awhile i commented out the htaccess files that had 'Deny from all' in them and my site went back to normal. I contacted my hosting provider TMDHosting and they came back with this:

----------\
It seems that there should be an issue with some of the rewrite URLs your website is using and the LightSpeed http service running on the server. The options to have the issue resolved are:

1. You may request from your website developers to recreate the rewrite rules for the website compatible with LightSpeed web service.
2. If you would like we will migrate your website to a server with normal Apache. If all the rewrite URLs are correct for the regular Apache web service the issue should be resolved.
----------/

I'm running a Zikula website. Here is what the htaccess looks like:

File: $Id: .htaccess 26262 2009-08-20 05:35:53Z drak $
# ----------------------------------------------------------------
# Purpose of file: block any web access to files stored under
# the modules/ directory
# ----------------------------------------------------------------
SetEnvIf Request_URI "\.css$" object_is_css=css
SetEnvIf Request_URI "\.js$" object_is_js=js
SetEnvIf Request_URI "\.jpg$" object_is_jpg=jpg
SetEnvIf Request_URI "\.gif$" object_is_gif=gif
SetEnvIf Request_URI "\.png$" object_is_png=png
SetEnvIf Request_URI "\.tif$" object_is_tif=tif
SetEnvIf Request_URI "\.swf$" object_is_swf=swf
SetEnvIf Request_URI "\.flv$" object_is_flv=flv
SetEnvIf Request_URI "\.ico$" object_is_ico=ico
SetEnvIf Request_URI "\.cur$" object_is_ico=cur
Order deny,allow
Deny from all
Allow from env=object_is_css
Allow from env=object_is_js
Allow from env=object_is_jpg
Allow from env=object_is_gif
Allow from env=object_is_png
Allow from env=object_is_tif
Allow from env=object_is_swf
Allow from env=object_is_flv
Allow from env=object_is_ico
Allow from env=object_is_cur

I'm really not sure what I need to do here other then having them move my website?

Last edited by NiteWave; 05-21-2010 at 08:07 PM..
Reply With Quote
  #2  
Old 05-20-2010, 08:10 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Current LiteSpeed does not support

Allow from env=

You can change those logic to using a rewrite rule, it more efficient.
Reply With Quote
  #3  
Old 05-20-2010, 08:44 PM
Morpheus Morpheus is offline
New Member
 
Join Date: May 2010
Posts: 8
Quote:
Originally Posted by mistwang View Post
Current LiteSpeed does not support

Allow from env=

You can change those logic to using a rewrite rule, it more efficient.
Can you give me an example? I'm at a complete loss here.
Reply With Quote
  #4  
Old 05-20-2010, 09:20 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
try this in .htaccess:
Code:
RewriteEngine On
RewriteCond %{Request_URI} !\.(css|js|jpg|gif|png|tif|swf|flv|ico|cur)$
RewriteRule (.*)	- [F]
Reply With Quote
  #5  
Old 05-20-2010, 09:33 PM
Morpheus Morpheus is offline
New Member
 
Join Date: May 2010
Posts: 8
Quote:
Originally Posted by NiteWave View Post
try this in .htaccess:
Code:
RewriteEngine On
RewriteCond %{Request_URI} !\.(css|js|jpg|gif|png|tif|swf|flv|ico|cur)$
RewriteRule (.*)	- [F]
Ok,

The only thing in the htaccess file is what you posted. I'm not actually sure what this does. How can I tell if it's working? What exactly is it doing?

Thanks...
Reply With Quote
  #6  
Old 05-20-2010, 09:42 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
Quote:
How can I tell if it's working? What exactly is it doing?
only files with one of extensions --- css|js|jpg|gif|png|tif|swf|flv|ico|cur are allowed to access under this folder and all sub folders.

otherwise, access to files with other extensions will return "403 Forbidden"
Reply With Quote
  #7  
Old 05-20-2010, 10:18 PM
Morpheus Morpheus is offline
New Member
 
Join Date: May 2010
Posts: 8
The problem occurred when my host apparently installed lightspeed. The changes you suggest, I did just completed on all my htaccess files that were formatted similar to the one I posted. Some only had html and some had gif,png,jpg. I formatted each to the example you gave to include the extensions that were only included in that particular htaccess file. All seems to be working. Now if for whatever reason my host needs to transfer my site to a non-lightspeed server will the changes I made be compatible?

The htaccess files were the original from my CMS. Should the developers be releasing the CMS with these changes to be more robust for the end user?

Thanks...
Reply With Quote
  #8  
Old 05-20-2010, 10:39 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
Quote:
Now if for whatever reason my host needs to transfer my site to a non-lightspeed server will the changes I made be compatible?
yes, they are apache directives. as long as the web server is apache or litespeed, these directives works.

Quote:
Should the developers be releasing the CMS with these changes to be more robust for the end user?
you can suggest them. despite of efficiency, at least the code is shorter than original one.

Last edited by NiteWave; 05-20-2010 at 10:46 PM..
Reply With Quote
  #9  
Old 05-20-2010, 10:52 PM
Morpheus Morpheus is offline
New Member
 
Join Date: May 2010
Posts: 8
I think two more quick questions;

1) Do in need to start out each htaccess file with 'RewriteEngine On'?

2) I wasn't sure about this 'you can suggest them. despite of efficiency'; are you saying that the new way is more or less effecient?



Thank you so much for the help.
Reply With Quote
  #10  
Old 05-20-2010, 11:07 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
1)yes.if no "RewriteEngine On", RewriteCond or RewriteRule won't work and will be ignored. However, if .htaccess has no RewriteCond or RewriteRule, you needn't "RewriteEngine On".

2)I think the new way is more efficient and obviously. However, I haven't tested it so without hard evidence...
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 11:15 AM.



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