But, if you encode the website uri, then the page name effectively becomes the encoded value. You don't actually gain anything other than obfuscating the original filename...
You could do it using symmetric encryption and a datetime stamp salt to vary the generated content, decrypt that and load your page. But considering that this is so much work for what I'd consider to be no gain, please consider the actual requirement as to why you need to obfuscate the file name.
I was just thinking of encrypting a part of the url and posting it in the URL region of the browser. so that it will be directed to a common page from where the encoded page name will be got and decoded and redirected to that page.
Just as the same as a middle-man service to encryption and decryption purpose of the data. I was just thinking about the possibility of doing that. If possible I am going to give it a try.
I know that there is no gain in it, but I need to try that logic to gain knowledge...
Well it's certainly possible, but you will need to adjust your routing so that you only ever have the root controller. When you retrieve the encoded section, you will need to decode it and load the appropriate view.
I have a scenario.. Can you please tell me whether It can be done in the following scenario.
My applicaion consists of an login form,welcome form and a mid.cs file. The mid.cs file contains the encode and decode functions. I got the steps until the url is encoded. Now the doubt is about is it possible to change the URL of the page to the encoded URL?
Hmm, if you're not using MVC then I honestly don't know. I can't imagine why not. If you have a general landing page, your links out of the page need to be your encoded values.
When you post to the page, you send your encoded values and then decode them with your mid.cs file. Once decoded you should be able to select the appropriate file for rendering.
As you will need to redirect your output, I don't know how this will be handled in normal ASP.NET (WebForms). In MVC, you can set the View explicitly so that the target filename will never be displayed.
I will ask a mod if your question can be moved to the ASP.NET forum, they might be able to give you a better answer than I can.
I don't know how this will be handled in normal ASP.NET (WebForms).
If you are using ASP.NET web forms, you can use the URL Rewrite module to help you with this.
What i would invision is that you need to direct all of you traffic to one page, then use some code in the Page_Load subroutine access the querystring (from the rewrite see below), then use the query string and decode the value, then based on the results, use server.transfer("newpage.aspx").
ASP.NET will show the user the contents of newpage.aspx, but will not change the URL in the address bar. If you perform a response.redirect, it would.
The URL rewrite code in your web.config may look something like this...
you need to have the URL Rewrite module installed on IIS.
I am using Visual studio 2010 to develop thi application. So I think there is no necessary of IIS installation. And also I am working in a office system, which does not allow an employee to easily install products.
You probably need to tweak the URL rewrite code above because not every URL will be incoded correct? How will the user access basic pages like home, about, etc..?
I am creating an web application in which there will be flow in the application such that after this page the user will be automatically redirected to the next page as programmed. So there is no need to worry about basic access page as you said.
If you are using Visual Studio, it has a local instance of a basic version of IIS. There's no support for the URL Rewrite module, as far as I know. However, you can also use ASP.NET Routing and add routes to a web form application in the global.asax. I have more experience with the URL Rewrite module. I really have not used the global.asax option, but take a look as this may be helpful for you.
Well Its a good link. But that is totally different from what i need. But anyway thankyou, As per Ketsuekiame answer, I can able to do that in a MVC architecture(Correct me if i am wrong). What are you thinking about that?
Unfortunately I am familiar with web forms, not MVC. I would address this design using the URL Rewrite module with a similar example I posted above. I am not sure what else I can add to give you more guidance on how to resolve this.
The key here is that when a user accesses a URL, the web server needs to know what to do with the request. You have to intercept it somehow and perform some action. URL rewriting handles this very well.
So lets go back to your original post. I assume that what you want is when someone accesses the following URL -->
Then, you want to take the string "sdDFREdsfefrvgrwghWr34r", decode it and then present the user the appropriate view, or send the user to another page. If that is correct, again, the only method I've used is URL Rewriting (in web forms).