Page 1 of 1

How to hide a url like this ?

Posted: Sun Jun 05, 2005 5:29 am
by crazytopu
Hi,

The site I worked on is now up and running. There is just one thing bothering me a lot. You see when you click on a link, you get url something like this-


http://www.ibcs-primax.com/link.php?link_id=29

I don't want to show my users the link, how other sites hide this?

Also, is it possible that you use PHP to create and display your links on-the-fly but visitors will see them as .htm file and not .php file? I guess, i have seen some sites doing so, so just wondering how do they do that.

Many thanks

Posted: Sun Jun 05, 2005 5:33 am
by anjanesh
You could hide the link in the browser's url using Apache's mode_rewrite : http://httpd.apache.org/docs/mod/mod_rewrite.html

But the page its coming from will still have that link in the anchor (<a>) tags.

Posted: Sun Jun 05, 2005 5:38 am
by Bennettman
It's possible to hide sent variables by putting them through POST instead of GET, but it'd require using Javascript on every single link to set form variables and submit a form, which is messy.

You can make .php appear to be .html files by using .htaccess to redirect (so if a user accesses page.html, they really access page.php):

Code: Select all

RewriteEngine on
RedirectMatch (.*)\.html$ $1.php