Member Avatar

my friend asked about masking real addresses shown in address bar...
normally:
http://www.myhost.com/index.asp?username=someone

he wants it like:
http://username.myhost.com

how can we do this??

instead of sending your form via "get", send it via "post". It is all hidden from the querystring. That's all you need to do.

Well, that above makes it come out to www.myhost.com/index.asp

if you wish to get it to be www.username.myhost.com then it deals with apache language and the .htaccess file. It's a rewrite file that will rewrite all your urls to the correct format. Something like this would go as:

RewriteEngine on 
Options +FollowSymlinks 
RewriteCond %{HTTP_HOST} !^(www\.)?mysite\.com$ [NC] 
RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.mysite\.com$ [NC] 
RewriteRule ^([^.]+\.asp)?$ http://www.mysite.com/$1?subd=%2 [L]

Don't quote me on this code, but at least now you know what you're into and where to look.

It's apache with an .htaccess file.

Member Avatar

thank you for the idea...