PHP application in sub directory keeps redirecting to main site

Question

I’ve got a PHP script which I have setup in a sub directory (public_html/phpscript) but when ever I try to access it via www.mysite.com/phpscript I get redirected to the main site with a 404 page not found.

The main site is a wordpress site with cloudflare enabled and wp-rocket plugin

Here is the main site .htaccess:

RewriteEngine On
Options +FollowSymLinks
Options -Indexes
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule . index.php [L,QSA]

Performace optimization

BEGIN Compress text files

AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
AddOutputFilterByType DEFLATE font/truetype font/opentype

# END Compress text files

BEGIN Expire headers

ExpiresActive On
ExpiresDefault “access plus 5 seconds”
ExpiresByType image/x-icon “access plus 31536000 seconds”
ExpiresByType image/jpeg “access plus 31536000 seconds”
ExpiresByType image/png “access plus 31536000 seconds”
ExpiresByType image/gif “access plus 31536000 seconds”
ExpiresByType application/x-shockwave-flash “access plus 31536000 seconds”
ExpiresByType text/css “access plus 31536000 seconds”
ExpiresByType text/javascript “access plus 31536000 seconds”
ExpiresByType application/javascript “access plus 31536000 seconds”
ExpiresByType application/x-javascript “access plus 31536000 seconds”

# END Expire headers

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

BEGIN Cache-Control Headers

Header set Cache-Control “public”

Header set Cache-Control “public”

Header set Cache-Control “private”

Header set Cache-Control “private, must-revalidate”

<filesMatch “.(woff|woff2|ttf|otf|eot)$”>
Header set Cache-Control “max-age=31536000 private, must-revalidate”

END Cache-Control Headers

<FilesMatch .php$>
SetHandler proxy:fcgi://sociplat-php73

0
Ihsaan 4 months 0 Answers 12 views 0

Leave an answer