Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

A prompt for a password

I have an link to a page in a password protected area (.htpsword) on a UNIX server. Every time I go to this link there is a "username/password" windows appears. This is fine, but when I click "cancel" on this window, there is generic "Authorization required..." page displayed.

Question: how can I make is stay on my page (without displaying "Authorization required..." screen) if I hit "cancel"?
0
alex1234
Asked:
alex1234
  • 3
  • 2
1 Solution
 
COBOLdinosaurCommented:
Post your code please.

Cd&
0
 
ZvonkoSystems architectCommented:
What do you mean with "stay"?
Do you mean return to the page where the authorization requesting link was placed?

There is no way to return to this public page where you come from by clicking authorized link.
The control is totally on server and no scripting can jump you back at some authentication code condition.

0
 
alex1234Author Commented:
COBOLdinosaur, there is no code - it's just an HTML link.

Zvonko, "Do you mean return to the page where the authorization requesting link was placed?" - yes! I said "stay" because to the user it looks like he didn't leave the page - the password dialog appears on the top of it. This is just a generic username/password dialog that pops up when you protect a page with .htaccess/.htpasswd files on UNIX servers.

"The control is totally on server" - what should I change on the server? I seen this behavior on some WEB site - I clicked "cancel" and no error page was displayed, I "stayed" on the original page.


0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ZvonkoSystems architectCommented:
Difficult to say without knowing what server you use.

Normally is there a way on every server to customize the output of error 401
For example you could have the option in httpd.conf to set some url for error page.
In the html of this error page you could place some line like:
<script>history.go(-1)</script>
 
Or
<script>window.location=window.referrer</script>

Or have a short message which redirects you after three seconds.

Good luck,
Zvonko

0
 
alex1234Author Commented:
I host my WEB site on a pay "virtual server" which means I'm not the only one who uses it. Can I create httpd.conf in my "virtual" space i.e. www.mysite.com/docs directory or httpd.conf is only one for entire physical server and changing it will affect other users?
 
0
 
ZvonkoSystems architectCommented:
This again a point I can only guess.
You still do not state what product your web server is.

Nevertheless is the correct one answering this question your technical support offered by your web hosting provider.

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now