我有一个问题我遇到了麻烦:/ 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问题:/
我正在创建一个PHP CMS,并有一些系统页面,如404页面,维护页面和未经授权的访问页面.如果找不到页面A,CMS将重定向到404页面; 如果用户无权访问页面B,它将重定向到未授权的访问页面等.
我想在每个页面的标题中使用正确的状态代码,但我需要澄清如何处理标题/重定向.我是否将404标题放在页面A上,然后重定向到404页面,还是将404状态放在404页面上?另外,如果后者是正确的答案,我应该使用什么样的重定向到达301或302?
我已经在本地机器上使用CodeIgniter开发了一个应用程序,并于昨天将其移至生产服务器(实时站点).
我的问题是,当我加载网站时,它会立即显示"找不到页面"错误(404).我100%肯定这与服务器本身无关,因为干净的CodeIgniter安装工作得很好.
我已经更改了config.php和database.php中的设置以反映新环境,因此它应该可以工作.日志文件没有显示任何有用的信息(只是在加载URI库后找不到index_php).
知道如何解决这个问题吗?
非常感谢您的帮助.
我正在使用WWW :: Mechanize来抓取网站,它的效果很好,除非有时会出现返回错误代码404或500(未找到或内部服务器错误)的页面,然后我的脚本将退出并停止运行.这真的搞乱了我的数据收集,所以无论如何WWW :: Mechanize会让我捕获这些错误,看看返回了什么样的错误代码(即404,500等).谢谢您的帮助!
我正在尝试获取给定页面的Web状态.但是当它出现404错误时,页面不会返回状态代码,而是抛出错误.
int status= webClient.getPage("website").getWebResponse().getStatusCode();
System.out.println( status);
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我希望看到网站何时超时,但是出于测试目的,我错误地想要网站的网址,看看我是否能看到404.
我在服务器下面的.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) 我需要在我的博客页面中创建一个分页器,直到这很好,但是当我点击我的分页链接时,我找不到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) 我已经读过许多错误代码,但对错误代码404和410有点困惑。到目前为止,我还没有区分这些错误的确切含义。
我无法让我的'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)
我有一个角度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类型,但这对我来说也不起作用.
我真的很想帮助理解并解决问题,欢迎任何建议!