Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I hide the page names from the address bar?

Status
Not open for further replies.

swalesy

Programmer
Jan 9, 2006
6
GB
Hi all,

This is my first post on here, hopefully someone can point me in the right direction.

I'm not sure who can help me as this is possibly more a design query than a programming one.

At the moment, I'm developing a C# application locally, so for example you log in to it at


Because I'm using Forms Authentication, if I try to go to any other page in the site, I get redirected to the login page, with a long query string indicating the page I was trying to go to. This all works fine.

My problem is that I want users to always be redirected to the login page, then when they navigate around the site, I want the url to stay the same. So for example, a user is on a page called Salaries.aspx, the address bar is showing


I want the address bar to actually always show


At the moment, I've tried using some frames, split into two, with the left most frame having a width of 0%.

I think what I'm doing is a workaround, not very elegant, can anyone advise me as to how I might do this better?

Thanks,

Steve
 
Hi

That workaround is the only way to do that. And you are right, that is not elegant. In fact, I consider it stupid. The user has the right to know what page is he visiting.

Feherke.
 
Thanks for your reply,

After speaking to a few other programmers I know, the only way to do it is with a html page and iFrames, however I don't agree with your statement that it's stupid and users have the right to see what page they're on from the address bar. I think what I'm doing is better for security, gives users and potential hackers less knowledge of how the site is built and is great for hiding query strings from users, again a good security measure. I think is users need to know the page they're on, it should be indicated on the page itself, the user doesn't need to know if it's a html, asp, aspx page, etc.
 
So no worries about search engine visibility then? and of course your end users can't add to favorites either.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
There aren't any problems adding the homepage to your favourites, you can still store it as
without specifying the page, IIS will direct the user to the login page.

I don't want users to try to bookmark individual pages of the application, I always want them to login via a login page, it's not like a public website, such as where you might want to bookmark the news page,
The application isn't going to be on the internet, just my company's intranet, so I'm not worried about search engine visibility.

Maybe I should have made that clear in the original post, like I said I'm new to this forum, thanks for your replies though.
 
I think what I'm doing is better for security, gives users and potential hackers less knowledge of how the site
Users, possibly. Hackers aren't going to be at all hampered by such easily by-passed "security".

Do it if you want to (I wouldn't bother, even on an intranet), but you don't need an <iframe>. Just make a regular frameset page with a single frame in it to hold the actual page.

Remember, btw, if you need to include links to pages outside your application, to include [tt]target="_top"[/tt] in your <a> tags.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Obscurity isn't security.

:)

If you really want to hide it, just use a frameset. But bear in mind that if you start getting into more complex frame structures and need to refresh more than one per click then you will have to start using javascript.

I too, wouldn't bother obscuring the address bar and have it so that any user that wasn't logged in would get shunted to the index/login page immediately anyway. As you more than likely will be doing in any case.

Foamcow Heavy Industries - Web design and ranting
Buy Languedoc wines in the UK
 
use links with a querystring to indicate the page to be on, capture this and store it in a session, 301 redirect back into the same page without a querystring, recover the session variable and use server.transfer to execute the page required and get the output into the index page, or use conditional includes to show the correct page output while remaining on the same page url.

For code to do this, ask in forum333 (ASP) or forum855 (.NET) It's not difficult for a programmer

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
is great for hiding query strings from users...
the user doesn't need to know if it's a html, asp, aspx page, etc.

Query Strings
It depends what you're doing.
[ul][li]POST - things that have an action (such as logging in, or editing something) should use POST (where data is not sent via query strings).[/li]
[li]GET - search is a good example: by using variables in the URL, you allow users to share the URL for a particular search[/li][/ul]

Page extensions (.asp, etc)
You're quite correct, the user doesn't need to know the technology behind the site. But you can use URL rewriting to hide the extension from everyone (including hackers) without resorting to framing hacks.

---
Marcus
better questions get better answers - faq581-3339
accessible web design - zioncore.com
 
Although the answer to swalesy has been answered I find it a little tiresome to keep hearing people repeating that "old chestnut" that framesets cause problems with search engines.

I have many framed sites and I have more problem hiding them from search engines than I do having visibility on search engines.

Perhaps those that believe that framesets confuse search engines could provide some evidence so that this matter could be settled.

Clive
 
I find it a little tiresome to keep hearing people repeating that "old chestnut" that framesets cause problems with search engines.

The main problem is bookmarking: whilst search engines can index individual frames, the link doesn't encompass the entire frameset.

A typical frameset could have a menu frame on the left, and the content on the right. Whilst the search engine will index the content, following the link will lead you into a content page, but you won't have a menu.

Similarly, framesets prevent a user from bookmarking a particular page, or emailing a link to a particular page to a friend.

---
Marcus
better questions get better answers - faq581-3339
accessible web design - zioncore.com
 
Well I guess we could talk about bookmarking but I was actually talking about search engines. Orphan pages can occur with or without framesets and the answer is simply to put a link back to the home page.

How do orphan pages occur with non framed sites?

Yes you can put a link back to the homepage, but that still means your page of content is shown out of context.

Also, if you put a link back tot he homepage then why not allow other navigation links too, in which case, why use a frameset?

There is no doubt that framesets have their place somewhere, but it's more than often unnecessary to use them. In fact I can't think of 1 project I have undertaken in the last 10 years where a frameset would have been useful.

Foamcow Heavy Industries - Web design and ranting
Buy Languedoc wines in the UK
 
An orphan page is any page that has no link back to the home page. It is good practice to include, on each page, a link of the form:

<a href="
This is true even if your page contains navigation. That is because from a printing standpoint all pages without that link will be orphan pages.

Clive
 
Yes, common convention is for the site logo/header to link back to the homepage.
It's rare to see a site that isn't framed and suffers from the problem you describe. I'm not saying it doesn't happen, but I would say that it happens a whole lot more with framed sites, in fact I'd go as far to say that the problem is a legacy of using framesets badly.

Foamcow Heavy Industries - Web design and ranting
Buy Languedoc wines in the UK
 
Hi Foamcow,

Maybe you are right. I agree that many framed sites are a complete disaster. Actually, your site, along with many others, some of my own included, suffers from the the problem I describe with respect to printing.

You have done a great job of making each page in your site be printable. However, say I printed your "about" page. The navigation links mean nothing on the printed page and if I looked at the printout at some later time, I would have no way of getting back to your site. If you had a link of at the bottom of the page this would solve the problem and not be redundant.

Clive
 
The about page is an oversight actually, thanks for pointing that out. It's not using the correct stylesheet for printing.
However, on that page there is a rather large "Foamcow Heavy Industries" logo. Google for "Foamcow" and you should get the site. Granted that won't be true for all sites, but any site built to modern standards is going to stand a fighting chance of ranking well with the site name as a search query.

By default, on a printed page from both Firefox and Internet Explorer is the URL of the document being printed. In FF it's top right, in IE it's bottom left. Granted again, that can be turned off, I'm not sure how many people turn it off though.

Perhaps I should expand the print stylesheet (used on other pages in the site) to show absolute URLs rather than relative ones, that would make sense I guess.

I still fail to see how frames help with that problem and it's much more likely to give no clue at all as to where content has come from (barring the sluglines from the browser).

Thanks for pointing out the stylesheet errors on my site though.

Regarding the (second) original point about frames, search engines and orphan pages. I don't see how the issue of printing is anything to do with search engine visibility.
The reason why "we" go on about framesets causing problems with search engines is because they can. Of course, they can be used in such a way as potential problems are eliminated (using javascript to maintain content in the frameset, putting links in the content page) - it is also true to say that a non framed site, done the wrong way can have problems of this nature.
The fact remains that it's easier, if you will, to do it wrong with a frameset. Add in the issues about bookmarking, orphan pages with no navigation, the requirement to use javascript to refresh more than 1 frame in a frameset at any time and you are opening a can of worms.
Sure, framesets have their place (as I stated earlier) but, again as I stated earlier, their use is often totally unwarranted and likely to cause more and more serious problems than through not using them.

I built and worked on sites that used frames in the mid(ish) 90s. Back then, they were great. We didn't have any other way to include common navigation files. We put up with the difficulties because we didn't know better.
Now we do. Now there are simple alternatives such as SSI and CSS. We don't need to use all those workarounds anymore.

A couple of years ago I took over the maintenance of a site that was built with frames. It was a nightmare. Simple requests were made difficult to implement without workarounds and fiddly javascript. The client insisted that we use frames without understanding why... because someone had told them it was the only way to do what they wanted. As an exercise I rebuilt part of the site using no frames, SSI and CSS. Despite it being obviously more efficient, easier to manage (not my opinion but that of management both in my company and the client's) and ranking better in Google the head honcho stuck to his guns and simply HAD to have frames.
The site died as it was too hard to maintain.
The whole thing became totally unworkable, and as far as I know it's still not working for them.

Anyway, enough thread hijacking.


Foamcow Heavy Industries - Web design and ranting
Buy Languedoc wines in the UK
 
My point was simply that if there were a link back to the homepage this is helpful in both framed and non-framed sites. In the case of framesets not only does it solve the printing problem but it also prevents any page from becoming an orphan even if js is turned off.

Clive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top