php-fpm subdomain rewrite problem
Hello there
The rewrite function does not work in some subdomains I have enabled php-fpm.
I see a not found error when I enter the rewritten pages.
Html pages and home page are also fine.
Apache log
Htaccess
[Thu Feb 23 01:23:46.537039 2017] [proxy_fcgi:error] [pid 11216:tid 107208547481344] [client 178.240.*.*:60759] AH01071: Got error 'Primary script unknown\n', referer: http://www.google.com.tr/
[Thu Feb 23 01:23:46.538710 2017] [proxy_fcgi:error] [pid 11216:tid 107208652609280] [client 84.51.*.*:60760] AH01071: Got error 'Primary script unknown\n', referer: http://tv.domain.com/
[Thu Feb 23 01:23:46.704341 2017] [proxy_fcgi:error] [pid 11216:tid 107208661464832] [client 84.51.*.*:60769] AH01071: Got error 'Primary script unknown\n', referer: http://tv.domain.com/
[Thu Feb 23 01:23:46.714214 2017] [proxy_fcgi:error] [pid 11216:tid 107208511764224] [client 151.135.*.*:60770] AH01071: Got error 'Primary script unknown\n', referer: http://m.facebook.com/Htaccess
RewriteEngine On
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
# remove ETag from images
Header unset ETag
FileETag none
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType application/javascript "access plus 216000 seconds"
Header set Cache-Control "max-age=2592000, public"
Header set Cache-Control "max-age=604800, public"
Header set Cache-Control "max-age=216000, private"
Header set Cache-Control "max-age=216000, public, must-revalidate"
Header set Cache-Control "max-age=1, private, must-revalidate"
Header set Access-Control-Allow-Origin "*"
# php -- BEGIN cPanel-generated handler, do not edit
# NOTE this account's php is controlled via FPM and the vhost, this is a place holder.
# Do not edit. This next line is to support the cPanel php wrapper (php_cli).
# AddType application/x-httpd-ea-php55 .php .phtml
# php -- END cPanel-generated handler, do not edit-
Hello @vacancy, The "Primary script unknown"error message occurs with PHP-FPM when a rewrite rule in the .htaccess file forces the use of a specific file that does not exist. RewriteEngine On RewriteCond $1 !^(index\.php|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L]
You can verify an index.php file exists in the document root where this happened to confirm that's what lead to the error message. Thank you.0
Please sign in to leave a comment.
Comments
1 comment