http-status-code-404

.htaccess RewriteRule to redirect url's containing specific parameters

荒凉一梦 提交于 2019-12-10 17:36:57
问题 I've seen several questions regarding similar requests, however, I'm not trying to redirect to a custom crafted URL. I just want to take common URLs that have been linked to and redirect them to a landing page. For example, I want to catch a specific URL like the following, but only this URL: http://example.com/forum/viewtopic.php?f=12&t=345 ...and redirect it to: http://example.com/landing-page.html I have a few links which no longer exist, so I'll be adding 4 or 5 redirects to more useful

CodeIgniter app shows 404 when moved to production

允我心安 提交于 2019-12-10 17:13:44
问题 I've finished developing an app using CodeIgniter in my local machine, and moved it to the production server (live site) yesterday. My problem is that when I load the site, it immediately shows me a "page not found" error (404). I'm 100% sure this has nothing to do with the server itself, since a clean CodeIgniter installation works perfectly fine. I've changed the settings in config.php and database.php to reflect the new environment so it's supposed to work. The log file isn't showing

Django renders the template `500.html` instead of `404.html`

孤街醉人 提交于 2019-12-10 17:13:35
问题 In one of my views I have the code: raise Http404 When DEBUG=False Django renders the template 500.html instead of the correct 404.html ! I can't understand why! EDIT: When DEBUG=True I get the standard one (by Django) Page not Found (404) You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page. What's more is that in the runserver console I see clearly the 404 code. Instead , when setting DEBUG

JSP / Servlet HTTP 404 error handling

不打扰是莪最后的温柔 提交于 2019-12-10 16:12:01
问题 I'd like to handle HTML 404 errors in my web app. I can write this: <error-page> <error-code>404</error-code> <location>/view/error404.jsp</location> </error-page> This works perfectly, but I want to log each of the invalid urls that the users type. When I use a scriptlet in the error404.jsp like this: <% System.out.println(request.getRequestURL()); %> I always get : http://localhost:8080/webApp/view/error.jsp, because the users will be forwarded to my error404.jsp from the invalid URL. How

Laravel 5.1 routing not working except '/'

倾然丶 夕夏残阳落幕 提交于 2019-12-10 15:59:53
问题 I have created a new laravel project in /var/www/polyforms.me and created virtual host file polyforms.conf : <VirtualHost *:80> ServerName polyforms.dev ServerAdmin webmaster@localhost DocumentRoot /var/www/polyforms.me/public ErrorLog ${APACHE_LOG_DIR}/polyforms.me-error.log CustomLog ${APACHE_LOG_DIR}/polyforms.me-access.log combined </VirtualHost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet When I go to polyforms.dev it opens home page as it should, but when I go to let's say polyforms

Detect 404 without catching exceptions

给你一囗甜甜゛ 提交于 2019-12-10 15:39:19
问题 Simple function: Check if a webserver returns a non-200 HTTP status. Private Function RemoteFileOk(ByVal Url As String) As Boolean Dim req As HttpWebRequest = TryCast(WebRequest.Create(Url), HttpWebRequest) req.Method = "HEAD" Dim rsp As HttpWebResponse = TryCast(req.GetResponse(), HttpWebResponse) Return (rsp.StatusCode = HttpStatusCode.OK) End Function I got it from this answer on "How to check if a file exits on an webserver by its URL?". Unfortunately, it doesn't work: A System.Net

Fix a 404: missing parameters error from a GET request to CherryPy

时光总嘲笑我的痴心妄想 提交于 2019-12-10 15:37:54
问题 I'm making a webpage using CherryPy for the server-side, HTML, CSS and jQuery on the client-side. I'm also using a mySQL database. I have a working form for users to sign up to the site - create a username and password. I use jQuery to send an AJAX POST request to the CherryPy which queries the database to see if that username exists. If the username exists, alert the user, if it doesn't, add it to the database and alert success. $.post('submit', postdata, function(data) { alert(data); });

Set variables to 404 in zend framework 2

陌路散爱 提交于 2019-12-10 15:37:31
问题 In my controller I throw a 404 response after an If statement, something like that : if ($foo) { $this->getResponse()->setStatusCode(404); return; } Then, I would like to send some variables to my 404 page. In my mind, I want to do something like that : $this->getResponse()->setVariables(array('foo' => 'bar', 'baz' => 'bop')); $this->getResponse()->setStatusCode(404); return; It's not the good solution, so how I have to do that ? And after, how to get these variables in my 404 view ? Thank

Magento 2 404 error admin panel

五迷三道 提交于 2019-12-10 14:58:17
问题 Recently I installed Magento ver 2.0 After successfull installation, I tried to login to admin panel but it say 404 not found. I am really not getting what is causing such issue. Moreover from the URL it can seen that I am logged into admin oanel but the dashboards is not visible. URL: Can anyone shed some light on this ? 回答1: I had the same issue. I had to enable the mod_rewrite module and set the AllowOverride to all for /var/www/html directory in the apache configuration file. 回答2: Maybe a

asp.net not displaying a custom 404 page as configured

╄→гoц情女王★ 提交于 2019-12-10 14:53:31
问题 in my web config I have: <customErrors mode="On"> <error statusCode="404" redirect="~/error/404.aspx" /> </customErrors> http://localhost/meh <-- standard 404 is shown http://localhost/meh.aspx <-- custom 404 is shown http://localhost/error/404.aspx <-- the custom error page I want shown for all 404 errors How do I have to setup my web.config to send all 404 to my custom error? Thanks 回答1: You have to configure this in IIS. By default, only specific files will get routed through the ASP.NET