0

Lets say for example that I have a CMS installed on a domain: mycms.com

With Joomla or WordPress on a LAMP environment (Linux, Apache, MySQL, PHP), lets say that it uses CPanel.

And I have a page like for example mycms.com/mycategory which links for different internal post/articles.

mycms.com/mycategory/post-1 mycms.com/mycategory/post-2

Now I have another domain: myotherdomain.com

And I want to setup this domain for that page (mycms.com/mycategory) In a way that every internal page also responds to that, example:

myotherdomain.com/post-1

myotherdomain.com/post-2

Notice, its not a simple redirect using PHP header() or JS, I want that myotherdomain.com to stay visible on browser address.

My question, this is possible? And its possible to do this without a dedicated server with SSH access? How I may do this? Editing my .htaccess?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
  • Possible duplicate of [Map Domain to WordPress Page](https://stackoverflow.com/questions/12505635/map-domain-to-wordpress-page) – Abhinav Verma Aug 23 '17 at 20:28

1 Answers1

0

Yes, you can. As you say, it's not a simple redirect, but it's a Proxy redirect. You can solve such problems at any preceding reverse proxy or immediately in Apache with mod_rewrite's proxy flag (it is [P]).

If you don't need any special pattern matching, you can even use PorxyPass:

ProxyPass "/post/" "https://mycms.com/mycategory/post/"
goteguru
  • 443
  • 3
  • 14
  • I do not have much experience besides Cpanel, but if I understand well I would need a VPS or a dedicated server that would allow me to edit Apache files correctly? Cpanel usually do not allow that? Or this is possible with a PHP or maybe a PHP.ini file? – user1967509 Aug 07 '17 at 13:19
  • You can use Redirect in .htaccess (with [P] flag). That way you don't have to mess around cpanel. You can not use ProxyPass in .htaccess. Alternatively you can insert any extra config lines in cpanel if you have sufficient rights. – goteguru Aug 07 '17 at 15:30