Member Avatar for tie372

I am making a website and I do not want it to have any URL extensions on it. For instance, when all links are clicked on instead of going to blah.com/bleh, the page goes to blah.com. How would I achieve this using php? With hidden forms? I will post an example of this soon.

EDIT: an example of this is http://runescape.com

if i understand correctly, that would take a special configuration of the server itself.

You can do this with frames, i.e. make blah.com/index.html a frameset document with a single frame, all pages and clicked links will appear to be the same page on the browser address bar.. Why you'd want to do this is beyond me, and you should be careful to load 'external' links using target="_top", since otherwise it'll look like all links are internal.

If you're on Apache, you can perhaps do this with ModRewrite directives in a directory .htaccess configuration. Research ModRewrite, it's pretty powerful, it allows you to basically fake the address bar address of a page, but it's usually used in the opposite direction ( i.e. to route pattern-matched page requests to a single server application ), so I'm not sure it'd be helpful here.

Otherwise, using forms instead of <a href=''..> and manually printing a different page depending on POST data will work, but it's an awful approach -- you lose any benefit of caching, and there's no way to bookmark individual pages.

The frames method is probably the best, in terms of usability + simplicity.

Update: Just looked at runescape.com; the frames approach is exactly what they are doing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.