ASP .NET - Hiding true adress of web page

  • Thread starter Thread starter Slawomir
  • Start date Start date
S

Slawomir

Hello.
Simple question about webforms: How to hide true address of website ? To
this day a used "Server.Transfer()" to redirect to another page. In sql
server I have a table with data like this:

id adress
1 default.aspx
2 news.aspx
3 news.aspx?mpid=2&id=23
4 news.aspx?mpid=1
5 news.aspx?mpid=1&id=12
In page load I'm throwing id and redirecting to address. Unfortunately
in the source of page in browser true address is still visible. Any
idea how to hide it?

thanx for any advice,
Slawomir
 
Slawomir said:
Simple question about webforms: How to hide true address of website ? To
this day a used "Server.Transfer()" to redirect to another page. In sql
server I have a table with data like this:

id adress
1 default.aspx
2 news.aspx
3 news.aspx?mpid=2&id=23
4 news.aspx?mpid=1
5 news.aspx?mpid=1&id=12
In page load I'm throwing id and redirecting to address. Unfortunately in
the source of page in browser true address is still visible. Any idea
how to hide it?

If you are using asp.net 2.0, you can use URL Mapping. To use it, you add
to your web.config a section such as the following:

<urlMappings enabled="true">
<add url="~/Home.aspx" mappedUrl="~/default.aspx?tabindex=0" />
<add url="~/Forums.aspx" mappedUrl="~/default.aspx?tabindex=1" />
<add url="~/Faq.aspx" mappedUrl="~/default.aspx?tabindex=2" />
</urlMappings>

The "url" part is the one that the user will see, while the "mappedUrl"
is the actual page that you are delivering.
 
Hello.
Simple question about webforms: How to hide true address of website ?
To
this day a used "Server.Transfer()" to redirect to another page. In
sql
server I have a table with data like this:
id adress
1 default.aspx
2 news.aspx
3 news.aspx?mpid=2&id=23
4 news.aspx?mpid=1
5 news.aspx?mpid=1&id=12
In page load I'm throwing id and redirecting to address. Unfortunately
in the source of page in browser true address is still visible. Any
idea how to hide it?

Try using Server.Execute instead from your main page.
 
Alberto Poblacion pisze:
If you are using asp.net 2.0, you can use URL Mapping. To use it, you
add to your web.config a section such as the following:

<urlMappings enabled="true">
<add url="~/Home.aspx" mappedUrl="~/default.aspx?tabindex=0" />
<add url="~/Forums.aspx" mappedUrl="~/default.aspx?tabindex=1" />
<add url="~/Faq.aspx" mappedUrl="~/default.aspx?tabindex=2" />
</urlMappings>

The "url" part is the one that the user will see, while the
"mappedUrl" is the actual page that you are delivering.
Thanx for this advice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top