How to create your own custom 404 error page and handle redirect in SharePoint 分类: Sharepoint 2015-07-08 00:22 4人阅读 评论(0) 收藏
1. In your MOSS server, make a copy of
%systemdrive%\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\1033\sps404.html
and call it my404.html
2. Create a Virtual Directory in IIS under your MOSS root web application. For example /errors
3. Create your own redirect aspx page, for example /errors/my404redirect.aspx and code your redirect logic in there. This is a normal asp.net
page.
4. In my404.html, make the following change:
STSNavigate("/errors/my404redirect.aspx?oldUrl=" + requestedUrl);
5. Create a Console Application and insert the following code and run it in MOSS server
System.Uri webApplicationUri = new Uri(http://MyMOSSServer/);
SPWebApplication webApplication = SPWebApplication.Lookup(webApplicationUri);
webApplication.FileNotFoundPage = "my404.html"; //*note
webApplication.Update();
*Note: By default this is set to null. FileNotFoundPage needs to point to a html file that lives in %systemdrive%\Program Files\Common Files\Microsoft
Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\1033. The file needs to be html only.
6. Now when you browse to a page that doesn't exist, you should expect to be brought to the redirected page.
*Another note:
In IE there's a "Show friendly HTTP error messages" setting which is ON by default in Internet Options->Advanced. With this setting on, sometimes
your custom error page is not displayed. In order to override this setting, both my404.html and /errors/my404redirect.aspx from the above steps need to be larger than 512 bytes in size. Refer to the following KB about this setting: http://support.microsoft.com/kb/218155
* This seems to be working within a site collection context only, i.e.http://MyMOSSServer/sites/siteA if
sites is a wildcard inclusion managed path and siteA doesn't exist in MOSS then this URL will NOT trigger the custom 404 error page set to SPWebApplication.FileNotFoundPage property.
How to create your own custom 404 error page and handle redirect in SharePoint 分类: Sharepoint 2015-07-08 00:22 4人阅读 评论(0) 收藏的更多相关文章
- HTTP 错误 500.19- Internal Server Error 错误解决方法 分类: Windows服务器配置 2015-01-08 20:16 131人阅读 评论(0) 收藏
1.第一种情况如下: 解决方法如下: 经过检查发现是由于先安装Framework组件,后安装iis的缘故,只需重新注册下Framework就可以了,具体步骤如下 1 打开运行,输入cmd进入到命令提示 ...
- 404错误 标签: servlet浏览器 2016-11-16 16:58 61人阅读 评论(0) 收藏
404是资源没有找到,一般由于以下几个方面导致: 1.路径出错: a)检查web.xml中servlet的配置是否出错 b)浏览器访问是路径书写方式:http://localhost:8080/项目名 ...
- Android 应用中十大常见 UX 错误 分类: H1_ANDROID 2013-09-21 13:59 404人阅读 评论(0) 收藏
转载自:http://www.apkbus.com/android-5661-1.html 摘要: Android 开发者关系团队每天都会试用无数的 App 或者受到无数的开发者发来的请求评测的 Ap ...
- Struts2 Handle 404 error page and wrong action
1. To handle 404 not found yourself, just add this code to your web.xml <error-page> <error ...
- Handling HTTP 404 Error in ASP.NET Web API
Introduction: Building modern HTTP/RESTful/RPC services has become very easy with the new AS ...
- 在ASP.NET Core使用Middleware模拟Custom Error Page功能
一.使用场景 在传统的ASP.NET MVC中,我们可以使用HandleErrorAttribute特性来具体指定如何处理Action抛出的异常.只要某个Action设置了HandleErrorAtt ...
- Openning SharePoint - 80 website gives HTTP 404 Error, The webpage cannot be found ! on SharePoint 2013
ask: I tried to open the SharePoint - 80 throw Browse in IIS, but I get HTTP 404 Error (The webpage ...
- [转]在ASP.NET Core使用Middleware模拟Custom Error Page功能
本文转自:http://www.cnblogs.com/maxzhang1985/p/5974429.html 阅读目录 一.使用场景 二..NET Core实现 三.源代码 回到目录 一.使用场景 ...
- CREATE FILE encountered operating system error 5(Access is denied.)
这篇博文主要演示"CREATE FILE encountered operating system error 5(Access is denied.)"错误如出现的原因(当然只是 ...
随机推荐
- JAVA 1.9 面向对象之封装
1. 面向对象程序设计的三大基本特征:继承(Inheritence).封装(Encapsulation).多态(Polymorphism)2. 封装:类包含了数据与方法,将数据与方法放在一个类中就构成 ...
- Strus2第一次课:dom4j解析xml文档
xml文本标记语言: 常用于交换数据:独立于操作系统.编程语言数据存储:xml数据配置:灵活性强,可读性高可以使用css样式改变xml样式 xml解析技术:dom解析xml技术: sax解析xml技术 ...
- Js 常用函数
1. 算数函数(Math) 1)Js小数取整 常用于:分页算法 js 小数取整的函 .丢弃小数部分,保留整数部分 js:parseInt(/) .向上取整,有小数就整数部分加1 js: Math.ce ...
- IOC理解
控制反转(反转控制):谁控制了谁? 就是交换控制权1.A a =new A(); 要使用这个A 必须你去new他.控制权在a2.由第三方来进行创造这个A,你用的时候直接用就是.控制权在第三方. 3 ...
- sublime jsx 格式化工具
1.到Sublime Text 3\Packages\ 目录下 git clone https://github.com/ionutvmi/sublime-jsfmt jsfmt 2.重启sublim ...
- 网上找的Gif图片解析类
这个是搜到的大部分的答案 下面贴出来代码 public class MyGifView extends View { private long movieStart; private Movie mo ...
- 首页自动生成静态化html
由于平台老是出现间歇性502.排查发现,php死进程过多耗费大量系统资源. 除了优化代码之外,静态化可以减少php进程.缓解一下服务器压力. 把首页生成html后,出现问题频率下降.所以需要做首页静态 ...
- centos6.5安装lnmp环境
1.安装nignx的源,默认cenots6没有的. rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-cent ...
- Linux下怎么删除非空目录
rm -rf 目录名 解释: 1.r意思是删除目录,f意思是force的缩写,强制删除,不提示. 2.如果目录为空,可以用 "rmdir 目录名"删除. 3.如果目录不为空,可以用 ...
- 虚拟化--IO虚拟化基本原理
本文话题: IO虚拟化概述 设备发现 访问截获 设备模拟 设备共享基于软件的IO虚拟化 基于前端后端的IO虚拟化基于硬件的IO虚拟化 概述 从处理器的角度看,外设是通过一组I/O资源(端口I/O或者是 ...