1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Hiding Website Page Addresses

Discussion in 'Web Design & Development' started by TW.87, Jan 15, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. TW.87

    TW.87 Thread Starter

    Joined:
    Dec 29, 2005
    Messages:
    308
    Generally, the style in which I develop a website leaves me with long directory and file-name structures. Because of this, I would prefer to have these addresses hidden from display in the address bar.

    Is it possible to just have the website address, excluding the path of the page that is currently being viewed by the user? Rather than displaying "http://www.website.com/Website/Website/Website.php", it would display "http://www.website.com/", no matter what page the user was viewing?
     
  2. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    You could load the page in another frame. That is the only way I know of doing it. I am sure there are other more experienced webmasters around here that can give you a better answer.
     
  3. TW.87

    TW.87 Thread Starter

    Joined:
    Dec 29, 2005
    Messages:
    308
    I would prefer to stay away from the use of frames, if possible. Thankyou for the tip, though!
     
  4. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
    Do you know PHP? You can can have the user stay on index.php and use sessions to keep track of which page to show to them. Then you can require() the content of that page.
     
  5. TW.87

    TW.87 Thread Starter

    Joined:
    Dec 29, 2005
    Messages:
    308
    I am basically familiar with PHP...enough to do the most basic of coding, but nothing quite like what you are saying. I'll have a look at the link you posted, but can you explain in a little more detail what code I would need to include, and how it would operate?
     
  6. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
  7. TW.87

    TW.87 Thread Starter

    Joined:
    Dec 29, 2005
    Messages:
    308
    This sounds like what I'd like to do.

    How can I go about doing this? As I mentioned above, I'm not familiar enough with PHP, so if you can explain it as simply as possible, that would be good.
     
  8. namenotfound

    namenotfound

    Joined:
    Apr 30, 2005
    Messages:
    3,012
    You can do "domain masking".
    No matter what page you're viewing, it will never show more than the basic domain name.

    Bascally what happens is, each page is put into an <iframe> with 100% margins.

    One well-known site that does this is www.dot.tk and there are some examples of this if you search google for "domain masking"
     
  9. TW.87

    TW.87 Thread Starter

    Joined:
    Dec 29, 2005
    Messages:
    308
    I quite like the idea of having it set out, as suggested above, like "http://www.website.com/Website.php?Location=Website".

    Can someone explain, in relative detail, how I can do this?
     
  10. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
    PHP:
    switch($_GET['Location']) {
    case 
    'page1':
    include(
    'page1.html');
    break;
    case 
    'page2':
    include(
    'page2.html');
    berak;
    default:
    inclue('default.html'); }
     
  11. TW.87

    TW.87 Thread Starter

    Joined:
    Dec 29, 2005
    Messages:
    308
    Can you break this down more for me? I'm not familiar with PHP placement, so if you can let me know where this code should go, and what it means, that would be great.
     
  12. namenotfound

    namenotfound

    Joined:
    Apr 30, 2005
    Messages:
    3,012
    that code goes in index.php
    "case" is what the page name will be, example index.php?location=page1 would open page1.html (according to that code)
    "include" is where the actual file is at
    "break" just says "this is the end of this section"

    case 'page1':
    include('page1.html');
    break;

    ^ that will make index.php?location=page1
    case 'page2':
    include('page2.html');
    berak;

    ^ that will make index.php?location=page2
     
  13. TW.87

    TW.87 Thread Starter

    Joined:
    Dec 29, 2005
    Messages:
    308
    I've added that code and formatted things the way I needed to, but this error gets returned upon clicking a link:

    Code:
    Fatal error: Call to undefined function inclue() in c:\documents and settings\Primary\Desktop\local server\navigation.php on line 21
    
    I am running it on WAMP5 1.5.0, so it should be operating correctly on the local computer.
     
  14. GCDude

    GCDude

    Joined:
    Apr 1, 2005
    Messages:
    394
    typo "inclue" should be "include"
     
  15. TW.87

    TW.87 Thread Starter

    Joined:
    Dec 29, 2005
    Messages:
    308
    That fixed it. That's a great result to my original problem...thankyou everyone for your help!
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Solved Hiding Website
  1. jacksonjob0689
    Replies:
    0
    Views:
    320
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/434420

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice