So Im having quite trouble to get speaking URLs in TYPO3. I managed to make them work with this 2 lines in localconf.php
$TYPO3_CONF_VARS["FE"]["pageNotFound_handling"] = 'http://www.mysite.com/';
$TYPO3_CONF_VARS["FE"]["pageNotFound_handling_statheader"] = 'HTTP/1.1 404 Not Found';
But the problem is that if I type a inexisting page, it even though it will direct me to the homepage, it wont rewrite the URL in the browser. Is there something that can be done about this?
It's the correct behavior of 404 not to change the URL in the browser. For redirects we have 30x http status codes. But you can't send two http status codes at the same time (404 and 301).
It is kind of bad practice to redirect to a homepage instead of showing a 404-not found message. The users may be irritated, asking themselves why they are now on the homepage and not at the URL they typed in...
Related
we are using Vercel for making development fast .
in our react app , after payment page when payment redirect to our given url it gives 405 http error, how can we handle this?
I finally found the problem , it is coming from PayTabs's side
followings are the logic they are handling wrong:
when nothing is received from callback url , they should not redirect us with given redirect url
when we are giving an invalid callback url it make a GET request to given redirect url
when we are giving an valid callback url which returns 200 to them it make a POST request to given redirect url which is not supported by browser.
This error happens when your page does not use next js serverside rendering. I had same issue but solved it by converting the page from a static page to a server rendered page using getServerSideProps
I have created a React application, i am trying to secure a param which is sent as a initial query parameter in url, is there a way for the first public url request with post method?
http://localhost:3000/ GET i can download content
http://localhost:3000/ POST i got 404 error
(i am trying to find a way to get content like GET method request)
I hope my question is clear enough, i am looking forward to hearing your ideas,
In a basic complaints based db app, (CRUD) built on MEAN stack, I'm having issues while routing and Mongo returns 404 on console when I request for data based on hostel name.
https://github.com/ajayns/hostel-complaint-portal/tree/db-hostel-fix
This is the branch which I'm working that which has the issue.
enter image description here
I executed your code and found that you missed express listen code, because of this you were getting 404 error
And you can follow my github link, Here i made changes
I have a django backend and a angular/ui-router frontend. I would like to handle 404 errors (and 400, 403 and 500) on the frontend side. Meaning:
A client send a bad url (page not found)
I catch the exception with a custom error handler on the backend side
Return the 404
Magic!
The frontend redirects to something like www.example.com/#/error404
I could just return a django.shortcut.redirect from the backend side but I read here that crawlers from search engines do not like when you do not return a 404 error code on unknown page. With a redirect I'd be returning a 302...
Or is it just wrong to manage error pages on the client side ? This would be a shame because everything is managed by the frontend (header, footer, etc) so the 404 page would not be following the standard page layout.
Check out interceptors here,
https://docs.angularjs.org/api/ng/service/$http
Once you set that up, you should be able to redirect to a page according to the error you process.
I'd like to send a 404 error, and re-direct to a more attractive Error page for the user on Google App Engine.
I've tried adding this to my web.xml, but it doesn't work
<error-page>
<error-code>404</error-code>
<location>404.html</location>
</error-page>
The only information I have discovered comes from the old Google group
https://groups.google.com/d/topic/google-appengine-java/3C-pY5ta2HQ/discussion
I'd like to send the proper 404 header for search engines, and I'd like to present a nicer Error message to the user. Jason's suggestion at the end would mean sending a 302 and not a 404 so I don't think that is ideal for search engines. Is that the only choice? Any help, views appreciated.
Custom 404 pages are not supported for URLs your app handles, because once the request is directed to your application, it's up to it to return the response to the user. If you want to render an attractive 404 page, you should have your app return that as its response to a request that generates a 404. How you do that - via an internal redirect (not an HTTP one!) - or other functionality is up to you.