sage icon indicating copy to clipboard operation
sage copied to clipboard

Getting Roots to work with Litespeed

Open momofone opened this issue 14 years ago • 5 comments

Trying to get Roots to work with Litespeed. Downloaded and activated 5.1.0 and selected "yes" to all the options but still see all references to /wp-content/plugins/, /wp-content/themes/and /wp-includes in the source code. is there something specific to Litespeed I need to be doing?

Thx.

momofone avatar Apr 17 '12 01:04 momofone

people have had success on two alternative setups so far: Nginx and Lighttpd

is there a way to run .htaccess rules in litespeed? you'd need to edit first if statement in roots-htaccess.php

retlehs avatar Apr 17 '12 01:04 retlehs

I'm not a systems person but Apache's .htaccess rules normally work fine in Litespeed. This is what is currently in my .htaccess:


# Block the include-only files. 
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


# END WordPress

momofone avatar Apr 17 '12 02:04 momofone

this is a normal roots .htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^css/(.*) /wp-content/themes/roots/css/$1 [QSA,L]
RewriteRule ^js/(.*) /wp-content/themes/roots/js/$1 [QSA,L]
RewriteRule ^img/(.*) /wp-content/themes/roots/img/$1 [QSA,L]
RewriteRule ^plugins/(.*) /wp-content/plugins/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

retlehs avatar Apr 17 '12 02:04 retlehs

I have just installed Roots on my Litespeed server and the .htaccess rules work as intended after amending the roots-htaccess.php IF statement. Simply change Line 7 to:

if (stristr($_SERVER['SERVER_SOFTWARE'], 'apache') || stristr($_SERVER['SERVER_SOFTWARE'], 'litespeed') !== false)  {

This will work on both Apache and Litespeed.

Foxaii avatar Apr 29 '12 17:04 Foxaii

thx @Foxaii

retlehs avatar Apr 30 '12 01:04 retlehs