0

I have a drupal site running on a server with two domains pointed to it: domainA.com and domainB.com. I would like domainB.com to serve a specific landing page, http://domainA.com/landing-page. I know I can do a normal htaccess redirect like this:

RewriteCond %{HTTP_HOST} ^domainB\.com
RewriteRule ^$ http://domainB.com/landing-page [L]

Which will serve my users the correct content.

But I would rather the path wasn't added to the url. Is there a way to do a 'transparent' redirect for domainB.com so that http://domainB.com/ serves up the content from http://domainB.com/landing-page without modifying the url? So that it seems more like the 'homepage'?

1
  • I believe the options stated here are the only way but I could easily be wrong.
    – sareed
    Oct 16, 2015 at 21:55

1 Answer 1

0

At least two ways of doing this come to my mind:

1. "Masking" your subdomain and proxying the content. What you do in this case, is that besides your mod_rewrite's redirection, you use mod_proxy to show your other domain's content without changing your URL. Have a look at Using mod_rewrite for Proxying.

2. Using the Domain Access module. Another option, maybe overkill if you are going to use this only for one page, but useful if you have to repeat this with many domains/landing pages.

Since this module allows you to create individual homepages on a per domain basis, you just have to add a second domain (domainB.com) and set /landing-page as Drupal's default homepage in the domain settings. Now when you go to domainB.com, your url bar will just show http://domainB.com but will render /landing-page's contents (since it's the homepage).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.