marghoobsuleman / hashtagcms

HashtagCms, Use it as Headless CMS or Bundled, API enabled, Admin Panel, multisite, multi-tenant, multiplatform, multilingual with endless possibilities. The Most powerful, fast, user-friendly and secured platform. Made with PHP Laravel Framework.
https://www.hashtagcms.org
MIT License
18 stars 4 forks source link

[Default route] Non-existant path crashes the Kernel: errorMessage--->"Could not find the category." (Error in calling controller) #22

Closed DeRaja closed 2 years ago

DeRaja commented 2 years ago

Hello Marghoob,

Because HastagCMS uses its own routing, I see that there is no default route defined. It is very easy for any one to crash the Kernel and identify every sensitive detail of the installation.

You can verify this method of making a crash. Just enter any term in the URL of (what you call) category THAT DOES NOT EXISTS to make the Kernel crash. I entered /stories and got following crash error:

``

popluated "Error in calling controller (MarghoobSuleman\HashtagCms\Http\Controllers\FrontendController@index)"
errorMessage "Could not find the category."

``

It would be better to have a predefined route in the controller for routing that defaults to the main page like home, should a category or path does not exists.

marghoobsuleman commented 2 years ago

This is only available when APP_ENV=local Always try to set that in APP_ENV=prod when you are making it live.

DeRaja commented 2 years ago

Hi,

Yes. Have to learn a lot about config everywhere. This error disappeared after changing in .env to APP_ENV=prod. Thanks.