Laravel links cause an 404 file not found

2,914 views
Skip to first unread message

ddomb...@aegisns.net

unread,
Feb 6, 2014, 7:37:38 PM2/6/14
to phpde...@googlegroups.com
Hi, I was wondering if anyone knew the cause/fix to laravels links causing a 404 file not found error, I have set the document root in the settings.json file, which works when first accesses the .EXE but anything after that causes a 404.

Thanks

Czarek Tomczak

unread,
Feb 6, 2014, 8:09:30 PM2/6/14
to phpde...@googlegroups.com
Hi Ddombroski,

Do you have the debug console enabled? What do the logs show?

-Czarek

ddomb...@aegisns.net

unread,
Feb 6, 2014, 8:42:39 PM2/6/14
to phpde...@googlegroups.com
Yes, i Do.
- 20:41:19.031 DEBUG: OnBrowserCreated()
[0206/204119:ERROR:network_change_notifier_win.cc(160)] WSALookupServiceBegin failed with: 8
- 20:41:20.309 DEBUG: OnContextCreated()
- 20:41:20.690 INFO: GET 200 /
- 20:41:20.697 INFO: GET 200 /css/main.css
- 20:41:20.768 DEBUG: OnLoadingStateChange: loading = 0
- 20:41:22.699 DEBUG: OnLoadingStateChange: loading = 1
- 20:41:22.706 INFO: POST 404 /account/signin
- 20:41:22.346 DEBUG: OnContextCreated()
- 20:41:22.739 DEBUG: OnLoadingStateChange: loading = 0

Czarek Tomczak

unread,
Feb 6, 2014, 9:23:26 PM2/6/14
to phpde...@googlegroups.com
On Friday, February 7, 2014 2:42:39 AM UTC+1, ddomb...@aegisns.net wrote:
..

- 20:41:22.706 INFO: POST 404 /account/signin
..

Your application is using url rewrite patterns. You should be able to disable this feature, so that links start with something like "/index.php/account/signin". Look for "pretty urls" or similar in configuration files.

-Czarek

Czarek Tomczak

unread,
Feb 10, 2014, 10:37:51 AM2/10/14
to phpde...@googlegroups.com
I have created Issue 81 in the tracker to add support for url rewrite patterns in phpdesktop, so that migrating apps that require pretty urls is easier. Our Mongoose web server already supports url rewrite patterns. Though the syntax might be a bit different from Apache's one.

-Czarek

ddomb...@aegisns.net

unread,
Feb 10, 2014, 1:34:18 PM2/10/14
to phpde...@googlegroups.com
Great! I was unable to find how to properly disable this feature, even asked on the laravel forums and turned up nothing. So i will wait till this feature has been implemented into PHPDesktop. Thanks!

Czarek Tomczak

unread,
Feb 10, 2014, 5:01:37 PM2/10/14
to phpde...@googlegroups.com
On Monday, February 10, 2014 7:34:18 PM UTC+1, ddomb...@aegisns.net wrote:
Great! I was unable to find how to properly disable this feature, even asked on the laravel forums and turned up nothing. So i will wait till this feature has been implemented into PHPDesktop. Thanks!

Isn't your nick "Yah Ya" on stackoverflow? I've posted an answer with solution to laravel urls:


-Czarek 

ddomb...@aegisns.net

unread,
Feb 10, 2014, 5:25:45 PM2/10/14
to phpde...@googlegroups.com
No its not, im not a stack overflow member, but i will definitely check the post out. Thanks again!

Czarek Tomczak

unread,
Feb 11, 2014, 10:17:04 PM2/11/14
to
On Monday, February 10, 2014 11:25:45 PM UTC+1, ddomb...@aegisns.net wrote:
No its not, im not a stack overflow member, but i will definitely check the post out. Thanks again!

And let us know if that worked for you.

-Czarek 

Dobromir Mateev

unread,
Oct 25, 2014, 1:44:33 PM10/25/14
to phpde...@googlegroups.com
Hello,
Nothing of the above works.
URLs like /index.php/company works fine, but URLs with parameters like /index.php/company/{id} (which resolves to /index.php/company/5) throws 404.

I am new to PHP Desktop and the Mongoose web server, and I am wandering where is the issue? Is it Laravel issue or Mongoose with php-cgi issue ?

Could you give me some directions in order to research this problem and hopefully to come with some solution.

Thank you in advance.


On Wednesday, February 12, 2014 5:16:16 AM UTC+2, Czarek Tomczak wrote:
On Monday, February 10, 2014 11:25:45 PM UTC+1, ddomb...@aegisns.net wrote:
No its not, im not a stack overflow member, but i will definitely check the post out. Thanks again!

Czarek Tomczak

unread,
Oct 27, 2014, 3:59:04 AM10/27/14
to phpde...@googlegroups.com
@DobromirMateev See Issue 137 and the pretty-urls.php example:

Dobromir Mateev

unread,
Oct 27, 2014, 4:46:42 AM10/27/14
to phpde...@googlegroups.com
That fixes it.
Thank you very much.

Czarek Tomczak

unread,
Oct 27, 2014, 8:01:45 AM10/27/14
to phpde...@googlegroups.com
Basic url rewriting for 404 errors is now supported in phpdesktop 31.8. Pretty urls can now be implemented without the need of "/index.php" prefix. See comment #10 in Issue 81 for more details: https://code.google.com/p/phpdesktop/issues/detail?id=81#c10

@Dobromir thank you for the donation.

--
You received this message because you are subscribed to the Google Groups "PHP Desktop" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phpdesktop+...@googlegroups.com.
Visit this group at http://groups.google.com/group/phpdesktop.
For more options, visit https://groups.google.com/d/optout.

Dobromir Mateev

unread,
Oct 27, 2014, 8:09:54 AM10/27/14
to phpde...@googlegroups.com
Hi,
I've looked into your fix for Issue 81.
Do you think this is the best solution ?
I was looking to fix it either in 
    - mongoose.c, prepare_cgi_environment()
or
    - web_server.php, StartWebServer(), cgiEnvironment

Czarek Tomczak

unread,
Oct 27, 2014, 8:15:37 AM10/27/14
to phpde...@googlegroups.com
I don't know if that's the best solution. But it was straightforward to implement and works pretty well. It works by trapping 404 errors in Mongoose and making a 302 Found redirect to pretty-urls.php defined in settings.json, while appending the original 404 url after thee script name. Didn't see any side effects caused by the redirect, the "Back" in browser history works fine. If you think there is a better solution, then patches are welcome.

Dobromir Mateev

unread,
Oct 27, 2014, 8:43:33 AM10/27/14
to phpde...@googlegroups.com
Yes, the solution works for me.
I have a branch for the Desktop release, which has fixes like this.

Don't expect patches from me. I haven't touched C\C++ for more than 10 years :)

tony...@gmail.com

unread,
Apr 8, 2018, 5:45:32 PM4/8/18
to PHP Desktop
Hi there, I know this bug have been discussed a long time ago but I really need a help.

I am facing the same problem of url redirection in my fresh intall laravel 5.6 on phpdesktop-chrome-57.0-rc-php-7.1.3.

Everything works fine when you launch the app. but when I start adding links to new pages, the redirection on click is keeping throwing this Error 404: Not Found File not found . and the same error in the console. but the route and file existe I don't know what to do.

I have try to follow of the solution discussed here. but not working. I which to know exactly where I have to insert the __fix_mongoose_env_variables(){ ...} in my laravel app.

osaigbovo...@gmail.com

unread,
Dec 15, 2019, 6:01:28 PM12/15/19
to PHP Desktop
hy @tony am also facing the same issue, how did you later fix this?
Reply all
Reply to author
Forward
0 new messages