我们最近更新了我们的网站; 旧的有大约300页......新的大约有80页;)
这是因为在旧结构中,对于每个参数,我们都有很多页面.相反,现在我们只有一个页面带有"摘要".
例如,关于'car'参数的旧结构是:
现在,我们只有1页'汽车',里面都有.
实际上,我将所有子页面重定向到主页面,使用.htaccess 301重定向:
Redirect 301 /cars-tires.php http://www.example.com/cars.php
Redirect 301 /cars-engines.php http://www.example.com/cars.php
Redirect 301 /cars-accessories.php http://www.example.com/cars.php
Run Code Online (Sandbox Code Playgroud)
所以我们有很多不同的(即使主题是相同的)页面指向一个页面.
你觉得这对seo有好处,还是会更好地重定向旧的主页面并给旧的子页面找不到404?
当在ASP.NET中处理404错误时,可以设置404错误以重定向到将404响应代码发送到浏览器的页面,或者应该使用server.transfer,以便在URL保留时将404标头发送到浏览器相同?
我正在构建我的第一个ASP.NET MVC网站,我正在试图弄清楚如何实现404页面.
我应该创建一个名为"404Controller?"的控制器吗?如果是这样,我如何在IIS中注册此控制器,以便将404重定向到该页面?此外,在某些其他控制器代码未找到某些内容(例如,在数据库中)的情况下,如何将请求重定向到我的404页面?
该脚本将从URL中调用,example.com/photo.php?id=123或者example.com/photos/123取决于是否启用了漂亮的URL.
如果照片#123不存在,请求example.com/photos/123应该抛出404错误.但是,怎么样example.com/photo.php?id=123?
我在Mac OSX Lion上使用JBoss 7.1.0 AS.我无法弄清楚为什么我的一件工件没有部署.我将war文件复制到$ JBOSS_HOME/standalone/deployments目录.当我登录JBoss管理控制台时,它会告诉我我的war文件(名为"eventmaven.war")已启用.但是,当我访问http:// localhost:8080/eventmaven时,我得到了404错误页面
The requested resource (/eventmaven/) is not available.
Run Code Online (Sandbox Code Playgroud)
我的日志中没有任何内容(位于$ JBOSS_HOME/standalone/log/server.log或$ JBOSS_HOME/standalone/log/boot.log中)以指示我为何获得此404.任何人都可以想到一个原因或建议额外的故障排除步骤?
谢谢, - 戴夫
我正在尝试基于StackExchange的api结果松散地进行API排序.
所以这是我的json输出.
{
"items" : [ ... objects in here .... ]
"page" :
"page_size" :
"total_pages" :
"total_items_count" :
"maximum_quota" :
"remaining_quota" :
}
Run Code Online (Sandbox Code Playgroud)
非常简单.
现在,我不知道如果该人试图要求......产品或问题或其他什么,该项目不存在,该怎么做.
例如..
{
"items": []
... snipped ....
}
Run Code Online (Sandbox Code Playgroud)
我以为我会返回200和上面的Json,Items属性为空.
我的另一个想法是返回带有items属性的json,但是将响应http状态设置为404.
思想/标准?
无论如何,我真的想要回归json.为什么?配额.即使是空洞的结果仍然是api服务的合法打击.
问题
当我尝试寻找替代方法时,这是对昨天(未答复)问题(见此处)的后续跟进.
我添加了基本的
<error-page>
<error-code>404</error-code>
<location>/404search.jsf</location>
</error-page>
Run Code Online (Sandbox Code Playgroud)
..到我的web.xml.我现在需要获取用户输入的URL以提交给我的搜索功能,但我只设法获取当前URL(在这种情况下,... 404search.jsf)而不是用户输入的实际查询.
尝试
HttpServletRequest.getRequestURL 回报 http://www.website.com/foldername/404search.jsfHttpServletRequest.getRequestURI 回报 /foldername/404search.jsfHttpServletRequest.getQueryString 什么都不回报我想要它回来 /foldername/wrong-url-the-user-entered#anchor-if-there-is-any
细节...
想法是获取用户输入的URL(例如www.site.com/product/99999-product-that-cant-be-found或www.site.com/faq/support-question-that-doesnt-exist),REGEX它以删除连字符并使用99999 product that cant be found或运行搜索查询support question that doesnt exist.
有什么建议?
我有一个文件secret.php包含在内index.php,我想在有人试图secret.php直接访问时显示404错误页面.但
header("Location: this_site_certainly_does_not_exist");
Run Code Online (Sandbox Code Playgroud)
in secure.php不是解决方案,因为我希望在example.com/secret.php显示错误页面时,用户键入的URL(例如)在浏览器的URL栏中可见,而不是重定向.
我正在尝试上传然后访问图像.上传进展顺利,将图片上传到资源/图片,但是当我尝试从浏览器访问图像时,如http:// localhost:1337/images/image-name.jpg,它给了我404.我使用Sails. js仅用于后端目的 - 对于API,项目使用--no-front-end选项创建.我的前端是在AngularJS上.
我的上传功能:
avatarUpload: function(req, res) {
req.file('avatar').upload({
// don't allow the total upload size to exceed ~10MB
maxBytes: 10000000,
dirname: '../../assets/images'
}, function whenDone(err, uploadedFiles) {
console.log(uploadedFiles);
if (err) {
return res.negotiate(err);
}
// If no files were uploaded, respond with an error.
if (uploadedFiles.length === 0) {
return res.badRequest('No file was uploaded');
}
// Save the "fd" and the url where the avatar for a user can be accessed
User
.update(req.userId, {
// …Run Code Online (Sandbox Code Playgroud) assets image-uploading node.js http-status-code-404 sails.js
我们正在Ubuntu的nginx + php-fpm7上运行Wordpress网站。我们在使用Unbounce插件时遇到问题,他们的支持无济于事。该插件有一个弹出窗口,该弹出窗口动态创建一个页面(.html),该页面将加载到弹出窗口中。由于此文件实际上不存在,因此nginx返回404(请参见屏幕截图)。如何配置nginx将此请求进一步传递给php-fpm?
location /
{
try_files $uri $uri/ /index.php?$args;
}
Run Code Online (Sandbox Code Playgroud)
我的完整nginx配置在这里。有谁知道如何实现这一目标?