Controller or view for 404 error
sarankup opened this issue · 2 comments
Hi, below line is my controller.
F.route('/addmyinterests',addmyinterests,['post','authorize']);
I call this page via AJAX, something like the below
type:"POST",data:'value='+tobeadded_val,url:"addmyinterests", success:function(data){ $('#ui').html(data.r); }
In case the page is not unauthorized, in my AJAX, I can read the status and prompt to the users appropriately. Something like the below
(XHR.status){case 401:window.location='passport'};
For some reason, if user directly hit my URL as http://localhost/addmyinterests, then the server page response as below. Please advise how to either set template for this message or how can I redirect to login page from the server side.
404: Not Found
Thanks in advance.
Hi @sarankup,
send me a simple example as ZIP package on my e-mail.
Thanks.
Hi Peter,
Please find attached minimum working example. Once you run the server,
In home page, please click the "Show Me" button, and it will message the
"Unauthorized access" via my AJAX.
To authorize you can call /auth page and it will temporarily set
authentication. Now you can see the result using "Show Me".
My question is that, if someone URL to '/coolsubmit', then it show "404:
not found". Now my question is that, how to customize this "404: not found"
or set some page redirect.
Please advise.
On Sat, Jul 25, 2015 at 12:57 AM, Peter Širka notifications@github.com
wrote:
Hi @sarankup https://github.com/sarankup,
send me a simple example as ZIP package on my e-mail.Thanks.
—
Reply to this email directly or view it on GitHub
#36 (comment).