标签: http-status-code-404

Django,从php到Django

我有一个用Django完成的网站,以前用PHP和CodeIgniter完成.我已将网站移至Webfaction,更改了DNS和所有其他配置,但现在我的电子邮件中充满了以下错误:

Error (EXTERNAL IP): /index.php/main/leer/7497
Run Code Online (Sandbox Code Playgroud)

我不知道为什么Django应用程序正在寻找PHP应用程序中的页面,特别是因为PHP应用程序在另一个主机中.

django http-status-code-404 http-status-code-302

1
推荐指数
1
解决办法
275
查看次数

404标头响应,但页面显示确定?

我不是有问题的PHP站点的开发人员(我根本不会使用PHP!)但我被要求调查此问题.

基本上,我们其中一个网站上的大量页面似乎在使用Live HTTP Headers(Firefox Addon)和我们的一些报告工具时返回404标头响应,但是,当您将网址粘贴到浏览器中时,页面渲染很好.

我想知道什么事情可能会导致这种行为?

这是一个示例URL,它返回404标头响应,但渲染正常:

http://www.fancyapint.com/pubs/pub14​​61.php

有任何想法吗?

  • 更新:感谢您的反馈!听起来这个网站的开发者错误地在该页面中放置/留下了404状态代码.我将传递您提供的信息.再次感谢.

php http-status-code-404

1
推荐指数
1
解决办法
5242
查看次数

404重定向 - 子域名的htaccess问题

我已经设置了一个直接适用于家庭的重定向404,但它不适用于子域.我想要的是无论错误发生在哪里,都应该直接到我的主域www.domain.com下面是我的.httaccess文件请指教

.htaccess mod-rewrite redirect http-status-code-404

1
推荐指数
1
解决办法
2725
查看次数

是否可以为特定的子目录创建404错误页面?

是否可以为特定子目录制作自定义404页面而不是全局子页面?

我想要的

/ bla to show /404.html

和/子目录/ bla显示/subdirectory/404.html

html .htaccess subdirectory http-status-code-404

1
推荐指数
1
解决办法
322
查看次数

自定义404页面 - 是否需要404标题?

在我的项目中,我将所有请求路由到index.php.然后我检查$_SERVER['REQUEST_URI']白名单并显示相关内容.

现在,如果$_SERVER['REQUEST_URI']我的白名单中的任何内容都不匹配,我会显示一些"找不到页面"文本.实际上,它是一个自定义404错误页面.

我的问题是:header('HTTP/1.0 404 Not Found');在输出HTML之前是否需要编写?它实际上做了什么?无论如何在这种情况下显示我的错误页面是否重要?

php header http-status-code-404

1
推荐指数
1
解决办法
964
查看次数

自定义帖子类型给出404

现在我知道这已经涵盖了很多,但我已经阅读了以前的修复,并没有任何运气.

基本上我的问题的自定义帖子类型给我404错误.

到目前为止,我已经尝试了以下内容:

  • 将永久链接设置为默认值,然后再将其更改回来.
  • 在register_post_type之前添加flush_rewrite_rules.
  • 我已经检查过,并且没有相同名称的页面和帖子.
  • 删除并重新创建了htaccess文件.
  • 添加'rewrite'=> array('slug'=>'question','with_front'=> FALSE)
  • 创建自定义永久链接结构.

代码如下:

add_action( 'init', 'irt_questions_create' );

function irt_questions_create() {

$labels = array(
    'name' => _x('Questions', 'post type general name', 'your_text_domain'),
    'singular_name' => _x('Question', 'post type singular name', 'your_text_domain'),
    'add_new' => _x('Add New', 'Question', 'your_text_domain'),
    'add_new_item' => __('Add New Question', 'your_text_domain'),
    'edit_item' => __('Edit Question', 'your_text_domain'),
    'new_item' => __('New Question', 'your_text_domain'),
    'all_items' => __('All Questions', 'your_text_domain'),
    'view_item' => __('View Question', 'your_text_domain'),
    'search_items' => __('Search Questions', 'your_text_domain'),
    'not_found' =>  __('No Questions found', …
Run Code Online (Sandbox Code Playgroud)

wordpress permalinks http-status-code-404 custom-post-type

1
推荐指数
1
解决办法
5444
查看次数

OpenShift的临时503和404托管了webapp

我在OpenShift上向WildFly 8.0.0部署了一个webapp.该应用程序目前只有很少的用户,但工作正常.对于WildFly,我使​​用一个免费的OpenShift帐户(我不知道它是否相关).

有时,当我访问应用程序时,我得到503(有时)或404(大多数时候)错误.

如果应用程序已经使用了一段时间(比如2或3天),我似乎得到了这些错误.大约一分钟,如果我重新加载页面,我会得到同样的错误.但大约一分钟后,我不再得到错误,而是应用程序正确可用.

看起来OpenShift"禁用"webapps如果它们已经使用了一段时间,然后根据需要"重新启用"它们(但在"重新启用"webapps期间显示503或404).

=>这是一个错误吗?这是一个众所周知的OpenShift问题吗?

=>如何防止我的webapp不可用?

问候

http-status-code-404 http-status-code-503 openshift wildfly

1
推荐指数
1
解决办法
1047
查看次数

如何在OWIN Katana中处理页面未找到错误?

假设我有hotfound.html页面,我想在找不到页面(或wab api方法)时显示它.

如何在OWIN应用程序中处理它?

谢谢

.net http-status-code-404 asp.net-web-api owin katana

1
推荐指数
1
解决办法
1423
查看次数

react-router v4:如何在子路径未命中时避免呈现父路由

我正在尝试将大多数路由渲染为AppShell包含导航栏的组件的子组件.但我想将我的404路由渲染为一个未包含的独立组件AppShell.

v2很容易:

<Router>
  <Route component={AppShell}>
    <Route path="/about" component={About} />
    <Route path="/" component={Home} />
  </Route>
  <Route path="*" component={NotFound} />
</Router>
Run Code Online (Sandbox Code Playgroud)

一切都按预期工作:

  • / 呈现 <AppShell><Home /></AppShell>
  • /about 呈现 <AppShell><About /></AppShell>
  • /blah 呈现 <NotFound />

但我无法弄清楚如何用v4做到这一点:

现在我正在这样做,但问题是渲染AppShell(没有孩子,但仍然是导航栏):

const Routes = () => (
  <div>
    <AppShell>
      <Match exactly pattern="/" component={Home} />
      <Match pattern="/about" component={About} />
    </AppShell>
    <Miss component={NotFound} />
  </div>
)
Run Code Online (Sandbox Code Playgroud)

有了这个:

  • /渲染<div><AppShell><Home /></AppShell></div>(好)
  • /about渲染<div><AppShell><About /></AppShell></div>(好)
  • /blah渲染<div><AppShell /><NotFound /></div> (问题 …

nested-routes http-status-code-404 react-router

1
推荐指数
1
解决办法
2444
查看次数

资产未考虑基本href网址-找不到错误

我只是在Webform项目中复制了我的角度构建脚本,然后将该项目部署在IIS中。

注意:我只复制了脚本文件,没有在IIS中单独部署。

我已经在webform项目的Scripts文件夹内复制了angular dist文件夹。

现在我的基本网址是: http:// localhost / Angular2 /

-在角度我已经设置了基本href,以“../../Scripts/dist”里面的index.html文件。

一切工作正常,如路由,加载图像,js文件等。仅svg图标未加载,并出现404 Not Found错误。

对于Angular页面,除svg外,所有内容(css,jpg,js)均从http://localhost/Angular2/Scripts/dist/main.js等加载 。

但是svg图标正在尝试从路径
http://localhost/Angular2/assets/features/home.svg获取负载,而不是从http://localhost/Angular2/Scripts/dist/assets/features/home.svg

我不确定为什么对于svg图标,基本href无法正常工作。

下面是我使用材质库使用svg图标的代码。

constructor(iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) {
    iconRegistry.addSvgIcon('home', sanitizer.bypassSecurityTrustResourceUrl('/assets/features/home.svg'));
    iconRegistry.addSvgIcon('library', sanitizer.bypassSecurityTrustResourceUrl('/assets/features/library.svg'));
    iconRegistry.addSvgIcon('guest', sanitizer.bypassSecurityTrustResourceUrl('/assets/features/guest.svg'));
Run Code Online (Sandbox Code Playgroud)

如果我用下面的一行修改了上面的行,那么它工作正常。

constructor(iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) {
    iconRegistry.addSvgIcon('home', sanitizer.bypassSecurityTrustResourceUrl('Scripts/dist/assets/features/home.svg'));
    iconRegistry.addSvgIcon('library', sanitizer.bypassSecurityTrustResourceUrl('Scripts/dist/assets/features/library.svg'));
    iconRegistry.addSvgIcon('guest', sanitizer.bypassSecurityTrustResourceUrl('Scripts/dist/assets/features/guest.svg'));
Run Code Online (Sandbox Code Playgroud)

我可以知道为什么base href不申请SVG图标吗?

提前致谢。

assets base href http-status-code-404 angular

1
推荐指数
1
解决办法
1608
查看次数