views:

44

answers:

2

Hi, Is it possible, if so how(!), to auto redirect a user that doesnt have access to a certain page?

I can see that in many cases this could be a complete pain for a user and confusing, but in my situation it would be ideal.

Thx in advance!

Steve

A: 

You can customise the accessdenied.aspx file in layouts folder.

Before customising it you need to take a copy.

with the writing of javascript (location.href=new file) code you can redirect user to other page.

Hojo
No no, please don't modify the OOB files in SharePoint. It's bad practice and will leave your SharePoint installation in an unsupported state.
Magnus Johansson
yeah im not really a fan of doing this.also, ideally i only want to apply the redirect to one page.
SteveCl
create a blank aspx page and give the name as accessdenied.aspx and write <script language="javascript">location.href="[url of new page]"</script>. then deploy this page layouts folder. thats it.
Hojo
A: 

Hi.

Yes, this is possible.

You can do it by creating a custom HTTP Module, which can override the default access denied page.

Here's an example.

Magnus Johansson
ok I'll take a look...never written a sharepoint module...so keep an eye out for a question about that!!! :-)
SteveCl
@SteveCI, no problems, just ask away. Added an example link.
Magnus Johansson