Home Should be simple domain alias ala mod_rewrite
Reply: 0

Should be simple domain alias ala mod_rewrite

user1728 Published in April 22, 2018, 12:49 am


I am using mod_rewrite on a Godaddy account, shared, cpanel linux webserver... I am trying to serve content from domain 1, when domain 2 is requested as an invisible redirect.. aka domain aliasing

domain1 is a wordpress site. I'm trying to get a wordpress /catagory/page to act as the content for domain 2. In fact domain 2 should have only that one page of content available, where we have a form 2 email page set up.

Ideally, Any other get requests should visibly redirect to the actual domain. Naturally a post request should go to the form on the aliased domain (2)...

Googling relevant search terms results in major information overload. I'm sure the answer is out there, I just can't find the solution to this exact scenario. Meanwhile I suspect Godaddy is caching .htaccess, making it even more difficult to find a working solution in a timely manner.

I've tried several variations, waiting 15 minutes between edits, flushing browser cache etc. I can't seem to find the correct syntax, and/or Godaddy caches .htaccess longer than 15 minutes.

My last attempt

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^www.domainalias.com$[OR]
RewriteCond %{HTTP_HOST} ^domainalias.com$
RewriteRule .* http://www.actualdomain.com/subdir/subdir/ [R=301,L] 

That seems like it should do exactly what I want, but it doesnt. It does show the domainalias address in the browser URL bar (GOOD) BUT, it displays the home page from http://www.actualdomain.com/ (BAD)

It should display http://www.actualdomain.com/subdir/subdir/ while keeping www.domainalias.com in the adress bar.

What am I missing ?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301672 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO