http-status-code-404

htaccess rewrite causes 500 error instead of 404

三世轮回 提交于 2019-12-01 06:17:33
问题 I've recently added this little bit of code to my .htaccess file: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ $1.php [L,QSA] Ok, I understand what's happening here, I think. This little bit of code to remove PHP file extensions causes a loop if the document is not found. This loop causes a 500 server error instead of the (proper) 404. Unfortunately I have very little understanding of what these rewrites are actually doing, so I don't know how to

render 404 page without redirecting in angular js

旧时模样 提交于 2019-12-01 04:21:39
问题 I am using ui.router & ngResource with AngularJS, & my question is : How do I RENDER 404 without redirecting to it e.g A user typed http://www.example.com/wrong-page-name , he should just be shown the 404 page, and the URL shouldn't change. Currently this is how I did it but it redirects angular.module('app') .run(['$rootScope', '$state', function($rootScope, $state) { $rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error) { if(error.status ===

.htaccess - ErrorDocument vs RewriteRule

人走茶凉 提交于 2019-12-01 03:48:17
I want requests for missing files and invalid directories to redirect to a custom 404 error page. I believe this can be accomplished using 2 methods. # redirect invalid requests and missing files to the not-found page RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ http://www.example.com/not-found.html [L] # same idea but using error document ErrorDocument 404 /not-found.html Is one option better than the other? When would I want to use one vs the other? The rewrite rule will not return the proper status code. Meaning that a browser will see your

Update RowKey or PartitionKey in Azure Table Storage

大城市里の小女人 提交于 2019-12-01 03:37:21
Can i update RowKey or PartitionKey properties of entity in Azure Table Storage? I thought yes or maybe just PartitionKey but now i am trying to do that(try to change RowKey or PartitionKey) and get error: The remote server returned an error: (404) Not Found. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The remote server returned an error: (404) Not Found. Source Error: Line 143: Line 144: var

Creating multilingual not found page in MVC

与世无争的帅哥 提交于 2019-12-01 02:48:10
问题 We have a multilingual website that has content in four languages.Every language is understood by the language name that we add at the first of our url. This is our routeConfig.cs: routes.MapRoute( name: "Default", url: "{lang}/{controller}/{action}/{id}/{title}", defaults: new { lang = "fa", controller = "Home", action = "Index", id = UrlParameter.Optional,title = UrlParameter.Optional } and this is generated the url: /en/ContactUs/Index Also, in our controllers we get the language name from

.htaccess - ErrorDocument vs RewriteRule

和自甴很熟 提交于 2019-12-01 01:10:28
问题 I want requests for missing files and invalid directories to redirect to a custom 404 error page. I believe this can be accomplished using 2 methods. # redirect invalid requests and missing files to the not-found page RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ http://www.example.com/not-found.html [L] # same idea but using error document ErrorDocument 404 /not-found.html Is one option better than the other? When would I want to use one vs the

404 Not Found Error when trying to access localhost on local LAMP server

ぐ巨炮叔叔 提交于 2019-12-01 00:00:29
I'm running Ubuntu. My Apache2 default file looks like this: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info,

How to style 404 page in WAMP server

99封情书 提交于 2019-11-30 22:15:42
I am using a WAMP server and I need to change the "404 not found page" style using CSS. How can I do it? In your httpd.conf file, there will be an ErrorDocument section: # # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects # # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html # After that, add this code: ErrorDocument 404 /error.html That will set the error page to a file

Sitecore uses “302 found” to redirect users to my custom 404 page - is that legitimate?

不羁的心 提交于 2019-11-30 20:40:55
This is more of a HTTP spec question than a Sitecore question. I have a 404 error page set up in Sitecore: <setting name="ItemNotFoundUrl" value="/404.aspx" /> So, when a user accesses a non-existent page (e.g. www.example.com/xyz) they get redirected to my custom 404 page (e.g. www.example.com/404.aspx). Sitecore performs the redirect using a 302 as seen in the Firebug screenshot below: Is this a problem? i.e. will Google and other search engines index my 404 page at the URL www.example.com/xyz? The site in question was originally set up to return "200 OK" responses from the 404 page (bad!)

404 page in REACT

北慕城南 提交于 2019-11-30 20:14:26
I created the component NotFound and it works fine when I go to a page that doesn't exist. But the same page it's appearing in all my pages, not only the one that doesn't exist. This is the component: import React from 'react' const NotFound = () => <div> <h3>404 page not found</h3> <p>We are sorry but the page you are looking for does not exist.</p> </div> export default NotFound And this is how I used it in the main page: class MainSite extends Component { render () { return ( <div> {/* Render nav */} <Route path='/dashboard' component={Nav} /> <Route path='/retrospectives' component={Nav} /