11 Replies - 2008 Views - Last Post: 11 July 2017 - 09:58 AM

#1 justawebuser   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 37
  • Joined: 09-February 14

403 Forbidden on LiteSpeed

Posted 07 July 2017 - 11:33 AM

Previously I had a website (http://zanganli.ir) running under nginx and everything was fine,Today I tried to install the CMS I'm using for some one else ,The new host provider uses LiteSpeed as webserver,The problem in the new website(http://zanjan.org) is when I try to load some php files,I got 403 error,for example http://www.zanjan.org/signin.php ,I set all file permissions to 777 but still I got the same error,I figured it out that when I add an slash to end of URLs having .php extension everything works fine: http://www.zanjan.org/signin.php/ My htaccess file is same for zanganli.ir and zanjan.org :

RewriteEngine On  
RewriteRule    ^([a-zA-Z]+)/rss\.xml/?$    rss.php/$1    [NC,L]
RewriteRule    ^fa/post/([0-9]+)/([^/]*)/?$    /post.php/$1     [NC,L]
RewriteRule    ^fa/product/([0-9]+)/([^/]*)/?$    /product.php/$1     [NC,L]
RewriteRule    ^fa/subject/([0-9]+)/([^/]*)/?$    /subject.php/$1      [NC,L]
RewriteRule    ^fa/gallery/([0-9]+)/([^/]*)/?$    /gallery.php/$1      [NC,L]
RewriteRule    ^fa/poll/([0-9]+)/([^/]*)/?$    /poll.php/$1      [NC,L]
RewriteRule    ^fa/([^/]*)$    index.php/$1   [NC,L]
RewriteRule    ^sitemap\.xml$    sitemap.php   [NC,L]
RewriteRule    ^posts(/?)$    posts.php   [NC,L]

However no matter what it is,Because I tried removing all the rewrite settings and I still got the same error for http://www.zanjan.org/index.php and http://www.zanjan.org/signin.php while http://www.zanjan.org , http://www.zanjan.org/signin.php/ ,http://www.zanjan.org/index.php/ and http://zanganli.ir/signin.php (running on Nginx) are all OK.So what's the problem? Thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: 403 Forbidden on LiteSpeed

#2 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2091
  • View blog
  • Posts: 6,398
  • Joined: 15-January 14

Re: 403 Forbidden on LiteSpeed

Posted 07 July 2017 - 03:26 PM

Remove everything from the htaccess file and see if it works. If it still doesn't, then htaccess isn't the problem. If it does, then add one thing at a time and see which one breaks it. I would also check the web server's error logs.
Was This Post Helpful? 0
  • +
  • -

#3 justawebuser   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 37
  • Joined: 09-February 14

Re: 403 Forbidden on LiteSpeed

Posted 08 July 2017 - 06:35 AM

Thank You ArtificialSoldier,I've tried removing the .htaccess and it didn't worked, Unfortunately I have no access to log files,Thank you anyway
Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3801
  • View blog
  • Posts: 13,787
  • Joined: 08-August 08

Re: 403 Forbidden on LiteSpeed

Posted 08 July 2017 - 07:12 AM

It looks like LightSpeed uses its own access control lists:
http://www.litespeed...essControl_deny
Was This Post Helpful? 0
  • +
  • -

#5 justawebuser   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 37
  • Joined: 09-February 14

Re: 403 Forbidden on LiteSpeed

Posted 08 July 2017 - 07:35 AM

View PostCTphpnwb, on 08 July 2017 - 07:12 AM, said:

It looks like LightSpeed uses its own access control lists:
http://www.litespeed...essControl_deny


Thank You CTphpnwb,To be honest I didn't get what this page has to do with my problem. Can you explain me? Thank you so much
Was This Post Helpful? 0
  • +
  • -

#6 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3801
  • View blog
  • Posts: 13,787
  • Joined: 08-August 08

Re: 403 Forbidden on LiteSpeed

Posted 08 July 2017 - 07:42 AM

That might be the wrong part of the page. Try
http://www.litespeed...onfig/reqfilter

I'm guessing that request filtering is the problem:

Quote

Enable Request FilteringGo to top
Description: Specifies whether to enable request content deep inspection. This feature is equivalent to Apache's mod_security, which can be used to detect and block requests with ill intention by matching them to known signatures.

Was This Post Helpful? 0
  • +
  • -

#7 justawebuser   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 37
  • Joined: 09-February 14

Re: 403 Forbidden on LiteSpeed

Posted 08 July 2017 - 08:04 AM

Thank You,But that's not the problem , if that's a request filtering ,Then you should be able to see this page http://zanjan.org/signin.php . Right?

This post has been edited by justawebuser: 08 July 2017 - 08:05 AM

Was This Post Helpful? 0
  • +
  • -

#8 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3801
  • View blog
  • Posts: 13,787
  • Joined: 08-August 08

Re: 403 Forbidden on LiteSpeed

Posted 08 July 2017 - 09:21 AM

Not necessarily. In most frameworks "/" is a request, so there is a difference between myurl.com/routename and myurl.com/routename/

It's obviously something to do with security, so I'd take a close look at the filters.
Was This Post Helpful? 0
  • +
  • -

#9 no2pencil   User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6697
  • View blog
  • Posts: 31,054
  • Joined: 10-May 07

Re: 403 Forbidden on LiteSpeed

Posted 08 July 2017 - 06:59 PM

This 403 error is not unique to PHP, moving to WebHosting & Servers.

View Postjustawebuser, on 07 July 2017 - 02:33 PM, said:

I set all file permissions to 777

This is a horrible first step for troubleshooting. Always check the logs & understand why the error is occurring, don't just start removing security.

View Postjustawebuser, on 08 July 2017 - 09:35 AM, said:

Unfortunately I have no access to log files,Thank you anyway

If this is a paid service, I would request them from customer support.
Was This Post Helpful? 0
  • +
  • -

#10 justawebuser   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 37
  • Joined: 09-February 14

Re: 403 Forbidden on LiteSpeed

Posted 10 July 2017 - 09:40 PM

I contacted customer support and they just set all file permissions to 644 and it worked! I'm wondering why that is..
Why 644 works but 777 doesn't ?
Was This Post Helpful? 0
  • +
  • -

#11 no2pencil   User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6697
  • View blog
  • Posts: 31,054
  • Joined: 10-May 07

Re: 403 Forbidden on LiteSpeed

Posted 11 July 2017 - 04:39 AM

Without being able to see details, I'm honestly not sure. Did you make any changes to directory permissions in addition?
Was This Post Helpful? 0
  • +
  • -

#12 justawebuser   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 37
  • Joined: 09-February 14

Re: 403 Forbidden on LiteSpeed

Posted 11 July 2017 - 09:58 AM

Not at all , They just told me your files permission setting was wrong and we set it right..
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1