Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
25% Recurring Discount on NVMe VPS
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
CloudLinux
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Htaccess conversion in OpenLitespeed

Harsh223Harsh223 Member
edited February 2018 in Help

I am using Open litespeed on my vps, can someone please help me configure/rewrite CakePHP's htaccess for openlitespeed based server.

Here are the different codes...

<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule>

<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule>

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] </IfModule>

<IfModule mod_rewrite.c> RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>

Thanks in advance...

Comments

  • http://open.litespeedtech.com/mediawiki/index.php/Help:Rewrite_Rule_Differences

    "For rewrite rules, OpenLiteSpeed uses the same syntax as Apache's mod_rewrite. Apache rewrite rules can be copied and pasted into OpenLiteSpeed's Rewrite Rules field (WebAdmin > Configuration > Virtual Hosts > your virtual host > Rewrite > Rewrite Rules)."

  • @LTniger said:
    http://open.litespeedtech.com/mediawiki/index.php/Help:Rewrite_Rule_Differences

    "For rewrite rules, OpenLiteSpeed uses the same syntax as Apache's mod_rewrite. Apache rewrite rules can be copied and pasted into OpenLiteSpeed's Rewrite Rules field (WebAdmin > Configuration > Virtual Hosts > your virtual host > Rewrite > Rewrite Rules)."

    I tried that, but cakePHP uses multiple htaccess files, so its not working... I need to convert it....

  • An what do you need to convert if it's support standard Apache mod_rewrite rules? Maybe rewrite to something else and not convert?

    If yes, than community would like to receive $7 or nude pics of your sister.

    Thanked by 1jetchirag
  • I've not tried but give a shot to

    RewriteEngine on
    RewriteRule    ^/$ app/webroot/    [L]
    RewriteRule    /(.*) app/webroot/$1 [L]
    
    RewriteRule    ^/$    webroot/    [L]
    RewriteRule    /(.*) webroot/$1    [L]
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^/(.*)$ index.php [QSA,L]
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^/index.php [L]
    

    If doesn't work, see if I missed something by following link given on above reply.

    Thanked by 1Harsh223
  • @jetchirag said:
    I've not tried but give a shot to

    > RewriteEngine on
    > RewriteRule    ^/$ app/webroot/    [L]
    > RewriteRule    /(.*) app/webroot/$1 [L]
    > 
    > RewriteRule    ^/$    webroot/    [L]
    > RewriteRule    /(.*) webroot/$1    [L]
    > 
    > RewriteCond %{REQUEST_FILENAME} !-d
    > RewriteCond %{REQUEST_FILENAME} !-f
    > RewriteRule ^/(.*)$ index.php [QSA,L]
    > 
    > RewriteCond %{REQUEST_FILENAME} !-d
    > RewriteCond %{REQUEST_FILENAME} !-f
    > RewriteRule ^/index.php [L]
    > 

    If doesn't work, see if I missed something by following link given on above reply.

    Nope It doesnt work :( I have tried almost everything but everything fails...

    This might help>>
    https://book.cakephp.org/2.0/en/installation/url-rewriting.html

  • For anyone searching this in future: Modified code was correct, problem was with configs
    Correct code again:
    1st file: (/)

    
       RewriteEngine on
       RewriteRule    ^/$ app/webroot/    [L]
       RewriteRule    /(.*) app/webroot/$1 [L]
    
    

    Seconds: (/app)

    
       RewriteEngine on
       RewriteRule    ^/$    webroot/    [L]
       RewriteRule    /(.*) webroot/$1    [L]
    
    

    3: (/app/webroot)

    
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^/(.*)$ index.php [QSA,L]
    
    
    
  • @jetchirag said:
    For anyone searching this in future: Modified code was correct, problem was with configs
    Correct code again:
    1st file: (/)

    > 
    >    RewriteEngine on
    >    RewriteRule    ^/$ app/webroot/    [L]
    >    RewriteRule    /(.*) app/webroot/$1 [L]
    > 
    > 

    Seconds: (/app)

    > 
    >    RewriteEngine on
    >    RewriteRule    ^/$    webroot/    [L]
    >    RewriteRule    /(.*) webroot/$1    [L]
    > 
    > 

    3: (/app/webroot)

    > 
    >     RewriteEngine On
    >     RewriteCond %{REQUEST_FILENAME} !-d
    >     RewriteCond %{REQUEST_FILENAME} !-f
    >     RewriteRule ^/(.*)$ index.php [QSA,L]
    > 
    > 
    > 

    I wish this worked for me, but I still have many issues specially with CakePHP, if somebody can help I really appreciate that.

  • @Chlitzxer said:

    @jetchirag said:
    For anyone searching this in future: Modified code was correct, problem was with configs
    Correct code again:
    1st file: (/)

    > > 
    > >    RewriteEngine on
    > >    RewriteRule    ^/$ app/webroot/    [L]
    > >    RewriteRule    /(.*) app/webroot/$1 [L]
    > > 
    > > 

    Seconds: (/app)

    > > 
    > >    RewriteEngine on
    > >    RewriteRule    ^/$    webroot/    [L]
    > >    RewriteRule    /(.*) webroot/$1    [L]
    > > 
    > > 

    3: (/app/webroot)

    > > 
    > >     RewriteEngine On
    > >     RewriteCond %{REQUEST_FILENAME} !-d
    > >     RewriteCond %{REQUEST_FILENAME} !-f
    > >     RewriteRule ^/(.*)$ index.php [QSA,L]
    > > 
    > > 
    > > 

    I wish this worked for me, but I still have many issues specially with CakePHP, if somebody can help I really appreciate that.

    there is an update, new option called "auto load htaccess" , should behave same as apache , don't need to modify the rewrite base.

  • ClouviderClouvider Member, Patron Provider

    Perhaps ask on the CakePHP mailing list,m or community, it’s ore likely someone had the same issue already..

  • @qtwrk said:

    @Chlitzxer said:

    @jetchirag said:
    For anyone searching this in future: Modified code was correct, problem was with configs
    Correct code again:
    1st file: (/)

    > > > 
    > > >    RewriteEngine on
    > > >    RewriteRule    ^/$ app/webroot/    [L]
    > > >    RewriteRule    /(.*) app/webroot/$1 [L]
    > > > 
    > > > 

    Seconds: (/app)

    > > > 
    > > >    RewriteEngine on
    > > >    RewriteRule    ^/$    webroot/    [L]
    > > >    RewriteRule    /(.*) webroot/$1    [L]
    > > > 
    > > > 

    3: (/app/webroot)

    > > > 
    > > >     RewriteEngine On
    > > >     RewriteCond %{REQUEST_FILENAME} !-d
    > > >     RewriteCond %{REQUEST_FILENAME} !-f
    > > >     RewriteRule ^/(.*)$ index.php [QSA,L]
    > > > 
    > > > 
    > > > 

    I wish this worked for me, but I still have many issues specially with CakePHP, if somebody can help I really appreciate that.

    there is an update, new option called "auto load htaccess" , should behave same as apache , don't need to modify the rewrite base.

    Nope not even CyberPanel support after I gave them access to the server, I am testing now under CyberPanel Enterprise because the issue is only related to the .htaccess configuration.

Sign In or Register to comment.