So i needed to make myself a search engine and then i started reading
about how to build/make one i came to the conclusion that my nice litte site with view.aspx?id=10&view=True really would work because search engine's only would read the view.aspx and not the ?id=10&view=True .
This mend i had to make or get my self a url rewriter first i found some stupid ISAPI dll's that could do it for me and then i can accross this little article URL Rewriting in ASP.NET.
Men that's alot of ready here is the short version just to get it to work.
First make sure you have a project where you wane use it in :D
Now download the source code of the Url Rewriting in ASP.NET article (Click here) and install the blody thing then get you self the URLRewriter.dll and put it into the bin dir from your project.
Now for the little harder part :D!
Open your project and open the Web.Config file.
Now add the following after <configuration> and before <system.web> :
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
Cool men now we included some config but you not done yet add the following after <system.web>:
<httpModules>
<add type="URLRewriter.ModuleRewriter, URLRewriter"
name="ModuleRewriter" />
</httpModules>
Now we included the httpmodule :D:D.
Now for the rules! this will also be done in the web.config and it will go like this just a example.
My self the problem was i had a file called view.aspx witch needed a id and view to work and displayed a product.
I needed to make the url look like this http://localhost/product/1/True/.aspx or http://localhost/product/2/False/.aspx a way to do this is add after </configSections> and before <system.web> the following code:
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/product/(\d*)/(\d*)/\.aspx</LookFor>
<SendTo>~/view.aspx?id=$1&view=$2</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
Now what this will do is display the page view.aspx?id=1&view=False if someones enters http://localhost/product/1/False/.aspx Good aint it you can also make a easyer rule or more then one let make one more if a user go's to http://localhost/product/ we want to display view.aspx?id=-1 one problem here http://localhost/product/ dus not make a .aspx this means that we will have to make the dir product and put a default.aspx file in it. After that you can add a other rull by adding the following between <Rules> and </Rules>:
<RewriterRule>
<LookFor>~/Product/default\.aspx</LookFor>
<SendTo>~/view.aspx?cat=-1</SendTo>
</RewriterRule>
Now the http://localhost/product/ also works :D.
Any that's all you have to do it's really easy :D:D Hope someone can use this have fun all :D:D
Happy .netting
