Solved: Hiding Website Page Addresses

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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?
 

Squashman

Retired 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.
 

TW.87

Thread Starter
Joined
Dec 29, 2005
Messages
308
Squashman said:
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.
I would prefer to stay away from the use of frames, if possible. Thankyou for the tip, though!
 
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.
 

TW.87

Thread Starter
Joined
Dec 29, 2005
Messages
308
brendandonhu said:
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.
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?
 

TW.87

Thread Starter
Joined
Dec 29, 2005
Messages
308
brendandonhu said:
You could have the links in your pages like this:
http://blah.com/index.php?page=abc

And you could then include() the text of abc.php into your page.
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.
 
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"
 

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?
 
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'); }
 

TW.87

Thread Starter
Joined
Dec 29, 2005
Messages
308
brendandonhu said:
PHP:
switch($_GET['Location']) {
case 'page1':
include('page1.html');
break;
case 'page2':
include('page2.html');
berak;
default:
inclue('default.html'); }
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.
 
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
 

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.
 

TW.87

Thread Starter
Joined
Dec 29, 2005
Messages
308
GCDude said:
typo "inclue" should be "include"
That fixed it. That's a great result to my original problem...thankyou everyone for your help!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Members online

No members online now.
Top