473,952 Members | 32,167 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

method for addresses masking

Please help me, I can't solve this problem:

I have domain:
http://www.main_domain.com/index.php...=2&parametr2=3
(and other site files like
http://www.main_domain.com/page1.php...erparameter=32
http://www.main_domain.com/page2.php...erparameter=11 etc.)
At this address there is an template site for many users. Personal site
is identified by userid.

I want to do short subdomain for all users like this:
www.hisowndomain.com?parametr1=2&parametr2=3
but this short address should call main domain (with masking long
address):
http://www.main_domain.com/index.php...=2&parametr2=3

www.main_domain.com/index.php?userid=23 --> www.hisowndomain.com

I tried to do it by .htaccess file (mod_rewrite) with no results, maybe it
is possible to do it in application server side?
Jul 17 '05 #1
4 2297
you should use the header() function, i think...
here is an example: http://ar2.php.net/manual/en/function.header.php

I don't know what are you specifically looking for, but you can try
something like this (without using a database):

# get userid from main_domain.com/index.php?useri d=xx
$id = $_GET['userid']
switch ($id) {
case '23':
header('Locatio n: http://www.hisowndomai n.com/');
break;
.... }

greetings

Jul 17 '05 #2
Dnia 21 Nov 2004 17:24:01 -0800, pa************@ gmail.com napisa³(a):
you should use the header() function, i think...
here is an example: http://ar2.php.net/manual/en/function.header.php

I don't know what are you specifically looking for, but you can try
something like this (without using a database):

# get userid from main_domain.com/index.php?useri d=xx
$id = $_GET['userid']
switch ($id) {
case '23':
header('Locatio n: http://www.hisowndomai n.com/');
break;
... }

greetings


Yes, but I want to have one php code and sql base placed at
http://www.main_domain.com/index.php...=2&parametr2=3
only identified and personalized by userid. It works fine but that address
is too long for users. I don't know what can I mask this long address and
hide it under short subdomain. I want to redirect www.hisowndomain.com to
www.main_domain.com/index.php?userid=23 but with address masking.

In your solution, I should update this code to all subdomains when it will
be changed :(
Jul 17 '05 #3
Apache rewrite is probably the best solution here. What you need is a
rewrite map that connects the domain names to the user ids, something like:

www.hisowndomain.com 23
www.herowndomain.com 24
....
www.joeblow.com 288

And then a rewrite rule that goes something like this:

RewriteMap domain-map txt: /var/domainmap
RewriteRule .*
%{PATH_INFO}?us erid=${domain-map:%{HTTP_HOST }}&%{QUERY_STRI NG}

Obviously, all the domain names have to map to the same IP address.

"Piotr" <pi**@gaztea.pl > wrote in message
news:1p******** *************** ******@40tude.n et...
Please help me, I can't solve this problem:

I have domain:
http://www.main_domain.com/index.php...=2&parametr2=3
(and other site files like
http://www.main_domain.com/page1.php...erparameter=32
http://www.main_domain.com/page2.php...erparameter=11 etc.)
At this address there is an template site for many users. Personal site
is identified by userid.

I want to do short subdomain for all users like this:
www.hisowndomain.com?parametr1=2&parametr2=3
but this short address should call main domain (with masking long
address):
http://www.main_domain.com/index.php...=2&parametr2=3

www.main_domain.com/index.php?userid=23 --> www.hisowndomain.com

I tried to do it by .htaccess file (mod_rewrite) with no results, maybe it
is possible to do it in application server side?

Jul 17 '05 #4
Dnia Mon, 22 Nov 2004 23:55:55 -0500, Chung Leong napisa³(a):
Apache rewrite is probably the best solution here. What you need is a
rewrite map that connects the domain names to the user ids, something like:

www.hisowndomain.com 23
www.herowndomain.com 24
...
www.joeblow.com 288

And then a rewrite rule that goes something like this:

RewriteMap domain-map txt: /var/domainmap
RewriteRule .*
%{PATH_INFO}?us erid=${domain-map:%{HTTP_HOST }}&%{QUERY_STRI NG}

Obviously, all the domain names have to map to the same IP address.


Thanks, it maybe work, but I can't check it because I have only access to
..htaccess file :(
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
3652
by: Dave Rahardja | last post by:
OK, so I've gotten into a philosophical disagreement with my colleague at work. He is a proponent of the Template Method pattern, i.e.: class foo { public: void bar() { do_bar(); } protected: virtual void do_bar() {} };
2
3970
by: Ginchy | last post by:
I have uploaded a small 3 page web using MS Publisher 2003 and after uploading I switched on url masking to cloak the url. I am certain that it worked fine. I simply changed the colour scheme in Publisher and reuploaded the page. The links no longer work? When I switch off url masking it works as it should?
19
21024
by: Scott Kelley | last post by:
From a byte containing only 1 bit, I need to find the number representing the bit position. Example: 00010000 = 4 00000001 = 0 Is there a simpler method than looping? Thanks,
87
3420
by: j0mbolar | last post by:
I've read in the standard that addresses basically can't be interpreted as integers. If they can, it is implementation defined behavior. However, if they can't be viewed as integers in any sense as far as portability goes, what then, should one think of addresses being composed of?
3
1322
by: Juggernaut | last post by:
I have a program that compiles without errors, but when I run it I get a segment fault. I have managed to trace where it happens, but since im new to C I don't know how to fix this or how I did it wrong. In main lets say I have 2 variables var1 and var2 that has values that I want to pass to a method for calculations with them. But I want to work with them later from main so I thought I'd make them pointers.
0
1409
by: Dana Epp | last post by:
I have a ToolBarButton that when I set it to disabled (button.Enabled = false;) causes a really ugly gray masking effect to take place. This is normal and the intended way of the button, but I would like to clean it up. Instead of using the gray mask, I want to use my own grayscaled high quality image. I thought by simply setting button.ImageIndex = new_num; (where new_num is the index of the grayscale image) I could do this. But alas, that...
11
1617
by: lakshmiram.saikia | last post by:
Hi, I need to do the following operation : '" I have two mac addresses, say X and Y,where X is the base mac address, and Y is the nth mac address from X, each incremented by one. Now,I want to check if Z falls within . I need to do some check only when Z is one of the mac addresses in this range. I am looking for an optimized method to do this as this check is going to be called in a high priority callback task, and
9
2285
by: Daniel Smedegaard Buus | last post by:
Hey all :) I was wondering about the $error_types (I particularly notice the 's' suffix when reading the manual) parameter for 'set_error_handler()': Can be used to mask the triggering of the error_handler function just like the error_reporting ini setting controls which errors are shown. Without this mask set the error_handler will be called for every error regardless to the setting of the error_reporting setting.
2
5346
by: meghla | last post by:
I can not understand how to implement bit masking on a c code?? while working with array it is taking too much time.................. so i need help. i need some suggestion and sample code of C dealing with bit masking..............; its argent............. plz help me.
0
10186
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11614
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11214
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11385
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10709
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9920
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8289
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6242
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3568
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.