Direct Page Access

S

Space Norman

I'm hoping to make a page on my website that can only be accessed by typing
in the actual page name. For example - consider a site with the following
pages.

mysite directory
....index.htm (home page for mysite.com
....Page1.htm (accessible via link on mysite.com home page)
....Page2.htm (accessible via link on mysite.com home page)
....Page3.htm (accessible via link on mysite.com home page)
....Page4.htm (NO links on home page)

I don't want Page4.htm to be accessible from a hotllink but rather require
that the user type in a specific page name i.e., www.mysite.com/page4.htm
Access to Page1.htm, Page2.htm and Page3.htm all work fine via the link. But
I can't seem to access any of them by typing in a specific page name. What
am I not getting?

Thanks
 
T

Trevor L.

I am no expert here, but I'll try

When the user types it in, I assume the result goes into a variable, call it
fred

Why not write some JS which says
location.href = 'http://' + fred

If this works, you could reduce the amount they have to type to just 'page4'
(without the quotes) and then use
location.href = 'http://www.mysite.com/' + fred + '.htm'
 

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

Top