Context help needed

Discussion in 'General OpenLiteSpeed Discussion' started by Aaron H, Oct 2, 2017.

  1. Aaron H

    Aaron H New Member

    I've recently installed OpenLiteSpeed and have been trying to transfer everything over from a shared host. I'm trying to turn my .htaccess files into working contexts but haven't been able to work out how to do so, if I visit my website it always returns a 404. Is anyone able to point me in the right direction?

    My folder structure is as follows:

    ├── cgi-bin
    ├── fcgi-bin
    ├── html
    │ ├── app
    │ │ └── folders
    │ └── public
    │ └── index.php
    └── logs
    ├── access.log
    └── error.log

    I've got 2 static contexts configured:

    URI: /
    Location: $VH_ROOT/html
    RewriteBase: /
    RewriteRules:

    RewriteRule ^$ public/ [L]
    RewriteRule (.*) public/$1 [L]
    URI: /public
    Location: $VH_ROOT/html/public
    RewriteBase: /public/
    RewriteRules:

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]

    The error log shows the following:

    [REWRITE] strip base: '/' from URI: '/'
    [REWRITE] Rule: Match '' with pattern '^$', result: 1
    [REWRITE] Source URI: '' => Result URI: 'public/'
    [REWRITE] Last Rule, stop!
    [REWRITE] prepend rewrite base: '/', final URI: '/public/'
    [REWRITE] strip base: '/public/' from URI: '/public/'
    [REWRITE] Rule: Match '' with pattern '^(.*)$', result: 2
    [REWRITE] stat( /usr/local/lsws/vhost/html/public/ ) failed
    [REWRITE] stat( /usr/local/lsws/vhost/html/public/ ) failed
    [REWRITE] Source URI: '' => Result URI: 'index.php?_url=/'
    [REWRITE] append query string '_url=/'
    [REWRITE] Last Rule, stop!
    [REWRITE] prepend rewrite base: '/public/', final URI: '/public/index.php'


     
  2. cyberpersons

    cyberpersons New Member

  3. Aaron H

    Aaron H New Member

    Thanks very much for your reply! I've read about the rewrite differences, but still fail to get it working. I've updated the rewrite rules as follows:

    RewriteUri: /
    Location: $VH_ROOT/html
    Rewrite Rules:

    RewriteRule ^/$ public/ [L]
    RewriteRule /(.*) public/$1 [L]

    RewriteUri: /public/
    Location: $VH_ROOT/html/public
    Rewrite Rules:

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^/(.*)$ index.php?_url=/$1 [QSA,L]
    The error log shows (when visiting website.com):

    [REWRITE] strip base: '/' from URI: '/'
    [REWRITE] Rule: Match '' with pattern '^/$', result: -1
    [REWRITE] Rule: Match '' with pattern '/(.*)', result: -1
     
  4. cyberpersons

    cyberpersons New Member

    Please create ticket here, so I can have a look.
     
  5. Aaron H

    Aaron H New Member

    I'm unable to create a ticket on that website. :( I'm running OpenLiteSpeed on my own server.
     
  6. cyberpersons

    cyberpersons New Member

    To create ticket you can order a trial Litespeed Enterprise license, your account will be created.
     
  7. Aaron H

    Aaron H New Member

    I've sent you a PM as I only get a .key-file and can't register.
     
  8. cyberpersons

    cyberpersons New Member

    Let me take a look.
     

Share This Page