Here is the scenario...

I have a website that orignated as an MLM / retail combination site...

It was determined that we needed some seperation between the Rep portion and the Retail portion, so I spent weeks modifying the code in over 40 scripts to separate a visitors path basedn on their point of entry, so all the displayed graphics and content are strictly either Retail or Representative related.

I made a huge oversight in the fact that the address bar still shows the URL of the MLM-representative domain...

I have a separate domain specically for the Retail side that is redirected to the primary domain / Retail side.

Now the question / request is
How can I mask the URL of the primary domain with the name of the Retail domain if they are redirected from there?

in researching masking, there appears to be multiple ways to do it, but it seems that the recommended method would be through the use of Mod ReWrite, but the examples are geared toward masking folder names as opposed to the domain name itself.

I would like to be able to mask the actual URL based on the value of either a SESSION variable, or whatever other means would be necessary and effective.

Hopefully this isn't to vague of a question and someone will be able to address it and at least point me in the right direction.

Thanks
Douglas

Member Avatar for diafol

Perhaps if you gave us an example of some domain names and the rewritten ones you wish to use. Also specifically which "variables" could be used to rewrite/redirect

OK, I just didn't want to confuse the issue with too much information, which is what appears to happen generally when I ask questions.

These are the domains of my development site, and not the live site, but identical structurally.

1) If a member is promoting Retail only (just adding to the customer base)
they use this URL:
http://247eClinic.com/position31

2) And if they are directing their promotions strictly to IRs (MLM),
they use this URL:
http://IR.Aim2Survive.com/position31

3) If a member is just promoting the site in general and gives someone
this URL:
http://Aim2Survive.com/position31

It takes the visitor to a decision page where they can either follow the patient information path or the representative information path.
What I would like is for the Address Bar to read 247eClinic.com if #1 is used or if #3 is used, and the visitor selects the patient information path.
Other than that it should read Aim2Survive.com

Ultimately, it will be a completely separate site, and this masking won't be necessary, but for now it would certainly resolve a lot of issues for me.

The .htaccess file that I currently use is this:

php_value session.gc_maxlifetime 14400
RewriteEngine On
RewriteRule ^([a-z0-9]+)$ /index.php?m=$1 [NC,L] # captures member username no case last rule
ErrorDocument 404 http://www.Aim2Survive.com/badlink.php

Which basically just captures the members username from the end of the url if one exists and sets it as the value of the variable $m. Then in the script, I get the value of $m and set it in a session variable to track which members site is being visited.

I hope this isn't TMI or confusing...

I don't understand the mod rewrite desriptions that I've found so far and just hoping someone can guide me through this.

thanks in advance.
Douglas

and just for clarity... the index page on 247eClinic.com contains this

<?php
if (isset($_GET['m'])){ // If arriving with username in url
  $memuser = $_GET['m'];  // gets site owner from .htaccess if first page visited
}else{
  $memuser='orphanage';  // default to the orphanage
}

  header('Location: http://aim2survive.com/?m='.$memuser.'&port=A');
  exit;
?>

When redirected to aim2survive.com the username is passed and the port that is being passed indicates to the system that it is a Retail only visitor.

Member Avatar for diafol

Ok, I'll have to read this a good few times before I get a grip on it. With regard to your first post. If you create generic classes, then your code should be reusable, obviating the need for rewriting, I presume. Anyway.

The separate domain thing. Is there a real need to have separate domains? Couldn't you just have subdomains?

Actually, the decision has been made that it needs to be a totaly separate entity, because the fact that there is an income opportunity (MLM) attached seems to have a negative impact on participation as a customer. So to circumvent that impact, total separation will remove the stigma and make it a clean retail product offering.

And if I would have been thinking clearly when this issue arose about a month ago, I would have just done that immediately, especially with the amount of time I have ended up investing in this 'FIX' that will end up being temporary.

But like they say hindsight is 20/20...

And Yes, I agree on the Classes thing, and keep telling myself that I'll get to a break point where I can spend some time studying the development and usage of classes, but that point seems to keep getting pushed out further every day. I'm in way too deep in this project with the old style of code to try to change it at this point. Just need it working as it is and then maybe I can completely rewrite it in the background as I expect that it will be around for years to come and grow to become huge.

Thanks in advance for any thoughts you have on the masking of the url.

Douglas

Diafol,

Shall I assume (dangerous thing to do) that you weren't able to come up with any suggestions on how to accomplish this one?

I'm quickly concluding that I may be asking to do something that isn't possible.

What intrigues me is that my partner showed me how he does it with go daddy. He is not computer savvy at all.

He just bought a domain and set it to redirect to the live site and then selected 'With Masking' and put in what he wanted the mask to say.

After about 30 minutes to propogate, we went to the new domain, and it worked perfectly...

this is the masking site he bought. http://admin24houreclinic.com/

If I could figure out how they are doing that, then I might find a solution to my question...

Well, thank you for taking the time to give it some thought anyway.

Douglas

Member Avatar for diafol

sorry doug on holiday won't be back for 2 weeks

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.