tags:

views:

521

answers:

5

Hi,

I want to do Url rewriting in sharepoint . If anyone is having any idea how to achieve this in sharepoint.

Thr url rewrite would be like.. /www.ABC.com instead of www.ABC.com/pages/default.aspx and also like ww.ABC.com/ED.html instead of www.ABC.com/ED.aspx

Thanks, PS

+3  A: 

You'll need to implement an IHttpModule and to register it in your web.config /configuration/system.web/httpModules element, before SPRequest declaration.

Good luck!

EDIT: This article explains what you need to know: A Complete URL Rewriting Solution for ASP.NET 2.0. You can skip XML parametrization code.

Rubens Farias
Thanks Rubens for the reply but I was thinking to hear some more help related to it as I know I hv to do this by creating httpmodule and aslso making changes in the config sections....but I didn't get any gud link or article about sharepoint url rewriting....
TSSS22
And probably you wont find more data; remove Sharepoint from equation and to write a IHttpModule implementation; _later_ add it to Sharepoint
Rubens Farias
Spot on. I created a commercial product that does exactly what the orignal poster asks but it is not available yet. This becomes significantly more challenging in a farm with more than one web front end (WFE) server.
Jason Weber
I have code which also does same thing, but I'm under NDA;
Rubens Farias
THanks for the reply guys....I found some blogs related to asp.net url rewriting and they are using context.beginrequest . Could you tell me what modifications I need to make as far as sharepoint is concerned.I m new to sharepoint so don't know how to do this thing in sharepoint.I found this bloghttp://www.simple-talk.com/dotnet/asp.net/a-complete-url-rewriting-solution-for-asp.net-2.0/and I wanted to know if i can use same with sharepoint rewriting
TSSS22
under sharepoint, you just need to add your httpmodule BEFORE SPRequest on your web.config
Rubens Farias
I am confused...k i m using httpapplication.beginrequest but what you are saying is i need to use spbeginrequest ? while I m creating my httpmodule in visual studio? I knw i need to add httpmodule in web.config main thing is how to create and what to put in that httpmodule ....could you tell me in detail as I guess you have solution for this problem?
TSSS22
Thanks Rubens :-) ........I have been trying to implement this link only as this is the only closest bet I also found on net....but getting 404 not found. Did you try that in sharepoint?
TSSS22
+1  A: 

Solution on this link, I knew a few others using the open source http://urlrewriter.net but it is no longer running apparently.

F.Aquino
I tried this but its not working...its shwoing file not found after I activated the feature....
TSSS22
This appears to only work on a single front end machine, which may or may not be an issue.
Jason Weber
Hi, do you or anyone is having urlrewriter.net as it was the free source but the link is not working now. So If anyone is having that code?
TSSS22
A: 

I'm with the httpmodule way too. You can add a config file with the mappings.

Mauricio
A: 

Half way through........ :-)

Thanks Rubens for the link . I was also trying to implement that but was getting errors like

1)404 not found for every rule i was writing in web.config. 2)security exception

But finally its working perfectly. If anyone facing same problem tell me I will tell the solution.

But now the second problem is from inbound everything is fine. I have written rules and stuff but for outbound I means request generate from sharepoint they are not rendering for e.g.

For publishing

if I type http://ABC it is rendering perfectly with my rule and if there is a site called D in it I m typing http://ABC/D.........it is also gud(using rule http://ABC/D/Pages/Default.aspx)

but when I m on home page and I m clicking site D...it is going on

http://ABC/D/Pages/Default.aspx....nd it is showing 404 not found I want it rewrite also to http://ABC/D.............and this thing is for every page or site

ANY idea how to solve this problem....

Thanks, PS

TSSS22
A: 

I just wanted to throw this out there for you guys. I wrote a simple HTTPModule that does this without any configurations in the web.config file(outside of the declaration). Hope this helps.

http://stackoverflow.com/questions/1201180/best-practice-for-sharepoint-vanity-url-redirection/1201488#1201488

Clint