HansSchouten / PHPageBuilder

A drag and drop page builder to manage pages in any PHP project
https://www.phpagebuilder.com
MIT License
727 stars 180 forks source link

Page not found #2

Closed Vanguger closed 4 years ago

Vanguger commented 4 years ago

Hi! I did it according to the documentation, but I have: Page not found. How can I solve this problem?

HansSchouten commented 4 years ago

Hi! Thanks for your feedback. I closed the other 2 issues by processing your suggested fixes. Page not found is probably because you did not have created a first page. To do this, log in via /admin and create a page with route / (which means your homepage). All routes should start with a /, like shown in the Website Manager screenshot (https://github.com/HansSchouten/PHPageBuilder#website-manager). Soon I will add dummy data with a few initial pages which would help better understand and guide the process.

Vanguger commented 4 years ago

I couldn't log in to the admin panel. But I found the reason in the file .htaccess I deleted a few lines in this file, on my local server (redirect https, www)

chichenchuang commented 3 years ago

I install it with documentation. Page not found was happened via /admin. How do I fix it through .htaccess file? Thanks

Atif-Bashir-1998 commented 3 years ago

I install it with documentation. Page not found was happened via /admin. How do I fix it through .htaccess file? Thanks

Go to the .env file of your project (this file is inside the root directory of your project). Change the APP_URL and you will be able to access the /admin

maiman-1 commented 1 year ago

Also coming up with this error on the laravel-pagebuilder. Cannot access admin so, cannot login. What should I change the APP_URL to? Currently it is set to "http://localhost"

Edit: More info on this. On Laravel, I was able to solve this by changing line 256. on vendor\hansschouten\phpagebuilder\src\Core\helpers.php. The change was from:

$currentFullUrl = $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . urldecode($_SERVER['REQUEST_URI']);

to

$currentFullUrl = $_SERVER['APP_URL'] . $port . urldecode($_SERVER['REQUEST_URI']);

since $.SERVER['SERVER_NAME'] in my case was 0.0.0.0 (http://0.0.0.0/ is 16 characters) and $_SERVER['APP_URL'] was localhost (http://localhost/ is 17 characters), the difference in character causes some part of suburl (admin) to be partially removed to be dmin. I guess the real solution is to change the APP_URL to be whatever $_SERVER['SERVER_NAME'] is..