标签: http-status-code-404

为什么在404错误页面上有200 OK标题状态是不是很糟糕?

我有一个问题我遇到了麻烦:/ err404页面的200OK标题状态问题,虽然它应该是404标题.200好有什么问题?真有可能200 OK应该在404错误页面标题状态?

感谢建议!! 非常感谢!


我想它与.htaccess有关.这是我的.htaccess文件;

ErrorDocument 404 /err404.html

RewriteEngine On

RewriteRule ^login.html$ index.php?s=login&a=loginDo [QSA,L]
RewriteRule ^logout.html$ index.php?s=login&a=logoutDo [QSA,L]
RewriteRule ^([^/]*).html$ index.php?s=$1 [QSA,L]
RewriteRule ^members/([^/]*)$ index.php?s=profile&username=$1 [QSA,L]
RewriteRule ^([^/]*)/$ index.php?s=listing&search[cityString]=$1 [QSA,L]
RewriteRule ^([^/]*)/([^/]*)/$ index.php?s=listing&search[neighborhoodString]=$2 [QSA,L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*).html$ index.php?s=details&seo_friendly=$3 [QSA,L]
Run Code Online (Sandbox Code Playgroud)

我也有一些与此htaccess文件相关的麻烦:(

问题1; 当url像http://localhost/fdfcdcvdvdvbdf.html(不存在url)时,它会重定向到主页,但它应该重定向到err404.html.对这个问题有什么看法吗?对于像http://localhost/fdfcdcvdvdvbdf.ht或http:// localhost/fdfcdcvdvdv这样的url,err404重定向效果很好

问题2; 如何解决这个200 OK问题:/

header http http-status-code-404

4
推荐指数
2
解决办法
3667
查看次数

PHP重定向标头最佳实践

我正在创建一个PHP CMS,并有一些系统页面,如404页面,维护页面和未经授权的访问页面.如果找不到页面A,CMS将重定向到404页面; 如果用户无权访问页面B,它将重定向到未授权的访问页面等.

我想在每个页面的标题中使用正确的状态代码,但我需要澄清如何处理标题/重定向.我是否将404标题放在页面A上,然后重定向到404页面,还是将404状态放在404页面上?另外,如果后者是正确的答案,我应该使用什么样的重定向到达301或302?

php http-headers http-status-code-404

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

CodeIgniter应用程序在移至生产时显示404

我已经在本地机器上使用CodeIgniter开发了一个应用程序,并于昨天将其移至生产服务器(实时站点).

我的问题是,当我加载网站时,它会立即显示"找不到页面"错误(404).我100%肯定这与服务器本身无关,因为干净的CodeIgniter安装工作得很好.

我已经更改了config.php和database.php中的设置以反映新环境,因此它应该可以工作.日志文件没有显示任何有用的信息(只是在加载URI库后找不到index_php).

知道如何解决这个问题吗?

非常感谢您的帮助.

php codeigniter http-status-code-404

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

使用perl WWW :: Mechanize处理404和内部服务器错误

我正在使用WWW :: Mechanize来抓取网站,它的效果很好,除非有时会出现返回错误代码404或500(未找到或内部服务器错误)的页面,然后我的脚本将退出并停止运行.这真的搞乱了我的数据收集,所以无论如何WWW :: Mechanize会让我捕获这些错误,看看返回了什么样的错误代码(即404,500等).谢谢您的帮助!

perl www-mechanize http-status-code-404

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

HtmlUnit网页状态代码

我正在尝试获取给定页面的Web状态.但是当它出现404错误时,页面不会返回状态代码,而是抛出错误.

int status= webClient.getPage("website").getWebResponse().getStatusCode();
System.out.println( status);
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

我希望看到网站何时超时,但是出于测试目的,我错误地想要网站的网址,看看我是否能看到404.

java htmlunit http-status-code-404

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

404找不到我的.htaccess页面

我在服务器下面的.htaccess下面找不到页面规则,但它似乎不起作用.任何的想法?

RewriteEngine on
RewriteRule ^article_detail/([a-zA-Z0-9_-]+)/([0-9]+)\.html$ article_detail.php?article_det=$2
Options +FollowSymLinks
ErrorDocument 404 http://www.example.com/main/404_not_found.html


# compress text, HTML, JavaScript, CSS, and XML

<IfModule mod_ext_filter.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
Run Code Online (Sandbox Code Playgroud)

php http-status-code-404

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

分页链接不起作用/ page/2 - NOT FOUND - Wordpress

我需要在我的博客页面中创建一个分页器,直到这很好,但是当我点击我的分页链接时,我找不到FOUND页面,我需要知道我是否需要在面板中能够使用wordpress才能访问到?页= N.

功能:

    function get_pagination($the_query) {
    global $paged;
    $total_pages = $the_query->max_num_pages;
    $big = 999999999;

    if ($total_pages > 1) {
        ob_start();

        echo paginate_links( array(
            'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
            'format' => '/page/%#%',
            'current' => $paged,
            'total' => $total_pages,
            'prev_text' => '',
            'next_text' => ''
        ));
        return ob_get_clean();
    }
    return null;
}
Run Code Online (Sandbox Code Playgroud)

我的博客代码

$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
        // echo $paged;
        $produtos = new WP_Query(array(
            'post_type'      => 'blog', …
Run Code Online (Sandbox Code Playgroud)

php wordpress pagination http-status-code-404

4
推荐指数
3
解决办法
4万
查看次数

404和410错误代码之间的区别

我已经读过许多错误代码,但对错误代码404和410有点困惑。到目前为止,我还没有区分这些错误的确切含义。

seo http-status-code-404 http-status-code-410

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

Angular2中的404页面和延迟加载

我无法让我的'404页面'使用延迟加载模块.当我在浏览器中输入随机网址时,我只看到一个空白页而不是我的酷页404页.

这是我的路由配置

export const routes: Routes = [
  { path: '', redirectTo: 'dashboard', pathMatch: 'full'},
  { path: 'dashboard', loadChildren: 'app/dashboard/dashboard.module#DashboardModule'},
  { path: 'buckets', loadChildren: 'app/buckets/buckets.module#BucketsModule'},
  { path: '**', loadChildren: 'app/notfound/notfound.module#NotFoundModule'} 
];

export const routing: ModuleWithProviders = RouterModule.forRoot(routes);
Run Code Online (Sandbox Code Playgroud)

当我浏览/桶时,我看到块正在延迟加载,它显示了在Buckets模块中配置的相应组件,没关系.

但它不适用于404错误页面.通常,路径的'**'应该适用于所有其他不存在的路由,但事实并非如此.

有人可以帮忙吗?

-angular2 final(2.0.0)

routing http-status-code-404 angular

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

部署到Azure时,Angular 2应用程序上的错误404

我有一个角度2的应用程序与简单的server.js作为node.js BE.

我已经将我的应用程序部署到Azure,我就是应用程序加载并向我显示欢迎页面.

当我到达试图通过HTTP请求读取本地JSON的组件时,我收到404错误(我在本地环境中没有收到). 在此输入图像描述

读取json的代码如下:

private ReadFromJson(path: string): Observable<string[]> {
    return this._http.get(path)
        .map((response: Response) => <string[]>response.json())
        .do(data => console.log('All: ' + JSON.stringify(data)))
        .catch(this.handleError);
}
Run Code Online (Sandbox Code Playgroud)

传递的实际路径是控制台中显示的路径.

我做了两件事:首先我确保该文件实际上是使用Azure CLI,并且它按预期存在.

其次,在查看了很多帖子后,我发现的唯一其他解决方案是按照此处的建议添加MIME类型,但这对我来说也不起作用.

我真的很想帮助理解并解决问题,欢迎任何建议!

mime json azure http-status-code-404 angular

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