Daily Lucky Numbers:

Saving scores for SMF forums that reside in a sub-directory path

Started by Chen Zhen, August 07, 2022, 02:09:02 AM

Previous topic - Next topic

Chen Zhen

If your SMF forum resides in a sub-directory server path then you may have problems saving scores for some games.
In this scenario, a game may redirect to the parent directory of your forum path whilst showing a 403 path error.
Your solution is to adjust your server config or add a server config file in the main server path.

ie. for Apache
Main website url path is: https://mydomain.com
SMF url path is: https://mydomain.com/forum

Use FTP or your terminal to create a .htaccess file in your main server path for "mydomain.com" (not your SMF path but possibly its parent path)

htaccess possible contents:
RewriteEngine on
RewriteCond %{QUERY_STRING} act=Arcade
RewriteCond %{REQUEST_URI} !forum
RewriteRule (.*) https://%{HTTP_HOST}/forum/$1 [NC,L]


You area very clever man.

Since changing to the new host, when a game is played the submit button, if there was one, took you straight to the forums main page. So I followed your instructions above and added the .htaccess file to the domain, then low and behold I can now score games again.

Thank you very much
If you want play quizzes or games click below

Listen to Quizland radio here

Chen Zhen

No problem.

Keep in mind that the path of "forum" in the .htaccess file code from above may have to be edited with whatever unique path name is being used. The above is just an example for Apache.