-1

I want a redirect from a subdomain to an external URL to a page of this URL. I need to show the subdomain in the URL. Not the external domainname with path.

I tried it in .htaccess in the subdomain of this rootdomain. But nothing so far is working.

I have the following code:

RewriteEngine On RewriteCond %{SERVER_PORT} 80

RewriteCond %{HTTP_HOST} ^elvis.ocien.be$ [OR]

RewriteCond %{HTTP_HOST} ^www.elvis.ocien.be$

RewriteRule ^(.*)$ https://servicebox.be/quarki/software/elvis-dam/$1 [QSA,L,R=301]

I tried it with [P] instead [QSA,L,R=301] on the last rule. But that returns in a failure. Does anyone knows how to do this. Also with keeping the SSL HTTPS working?

Hope someone knows how to do this, thanks already

  • And external redirect won’t do then, you _have to_ use proxy functionality here then. Using the `P` flag requires that `mod_proxy` is available as well - is that the case? In general: Please go read [ask]. Saying stuff like _“But that returns in a failure”_ is not helpful, you need to give us a _proper_ problem description. – CBroe Apr 02 '20 at 13:44
  • Whether everything will work as intended, even if the proxy setup is done correctly, can probably not be guaranteed up-front - that depends too much on what that other site is doing in the background. If this is not a “hostile takeover” of someone else’s content, but there’s actually some cooperation / partnership / whatever between your two sites, then this would probably be a lot easier to set up on their end. – CBroe Apr 02 '20 at 13:48

1 Answers1

0

thanks for the reply,

I do not know how to see if mod_proxy is available.

I own and host both sites/domainnames and have access to the DNS settings, also in WHM and cPanel. So yes there is a partnership.

When I use the flag [P] it is giving me the following:

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at webmaster@elvis.ocien.be to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Hopefully my writing is better to understand now.

Thanks already, Kiona