Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
24 stars 19 forks source link

File not found in PHP-FPM environment by URL routing (without index.php) #1056

Closed hirorongl closed 2 years ago

hirorongl commented 4 years ago

File not found in PHP-FPM environment by URL routing (without index.php)

Apache2.4.25 PHP-FPM(PHP7.4)

errolog [proxy_fcgi:error] [pid 17780] [client 11.22.33.44:60312] AH01071: Got error 'Primary script unknown'

hirorongl commented 4 years ago

fix #1056 patch

---
 public_html/.htaccess.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/public_html/.htaccess.txt b/public_html/.htaccess.txt
index 05dd29726..0f3043a85 100644
--- a/public_html/.htaccess.txt
+++ b/public_html/.htaccess.txt
@@ -21,5 +21,5 @@ IndexIgnore *
     # Directs all Geeklog requests through the site index file
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
-    RewriteRule ^(.*)$ /index.php/$1 [L]
+    RewriteRule ^(.*)$ /index.php?/$1 [L]
 </IfModule>
\ No newline at end of file
-- 
hirorongl commented 4 years ago

一例として報告をあげておきます。

eSilverStrike commented 4 years ago

I am surprised that the original code doesn't work on PHP-FPM (could it be another reason why it is now working?). I can't test it myself though as I don't have my development server setup for it. I did test your updated code:

RewriteRule ^(.*)$ /index.php?/$1 [L]

and it does not work with a regular PHP site that use FastCGI.

If you can confirm your new line is required for PHP-FPM (and have tested it with articles, staticpages, print, topic etc...) I will add the line in as well commented out with an explanation in it along with updating the Geeklog docs.

eSilverStrike commented 4 years ago

I plan to release Geeklog v2.2.1sr1 this week. Can you confirm this works as suggested above? If so then I can included else I will push it to Geeklog v2.2.2

eSilverStrike commented 2 years ago

Commented out line was added to .htaccess.txt to give an option for those who use PHP-FPM