WebDev

SMF Arcade => SMF Arcade Support + Plugins => Topic started by: Chen Zhen on August 07, 2022, 02:09:02 AM

Title: Saving scores for SMF forums that reside in a sub-directory path
Post by: Chen Zhen on August 07, 2022, 02:09:02 AM
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]
Title: Re: Saving scores for SMF forums that reside in a sub-directory path
Post by: Dave on August 07, 2022, 05:09:16 AM
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
Title: Re: Saving scores for SMF forums that reside in a sub-directory path
Post by: Chen Zhen on August 07, 2022, 10:26:03 PM

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.
Title: Re: Saving scores for SMF forums that reside in a sub-directory path
Post by: Skhilled on August 13, 2022, 02:21:34 AM
Cool! I'll try this as well.
EhPortal 1.39.6 © 2024, WebDev