Configure PHP by Directory or File Error Using Rewrite Method

Pong

Administrator
#2
Permission issue is one of the common reason for 500 errors. Can you show me the real example URL with the problem " Resource interpreted as Stylesheet but transferred with MIME type text/html: "? If you don't want to give your real URL on this public forum, feel free to log a ticket with us by sending email to support@litespeedtech.com, we can take a further look.
 

lsqtwrk

Administrator
#3
if you are using rule like this

RewriteRule ^test/.*$ - [H=application/x-httpd-lsphp70]

it will match all the request to run as lsphp , even its png , jpg , or css , js ...etc , that .* matches everything.

you will need a rewrite cond to check if it's PHP before redirect, or set rewrite rule pattern to match .php only.
 
#4
if you are using rule like this

RewriteRule ^test/.*$ - [H=application/x-httpd-lsphp70]

it will match all the request to run as lsphp , even its png , jpg , or css , js ...etc , that .* matches everything.

you will need a rewrite cond to check if it's PHP before redirect, or set rewrite rule pattern to match .php only.
Yeah I ended up doing that. This worked for me.

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{THE_REQUEST} \s/([^?.]+)(?:\.php)?[?\s] [NC]
RewriteRule ^ - [H=application/x-httpd-lsphp73]
 
Top