0

I have the following problem.

I want to rewrite all requests from domain abc.de to example.com but the query in the browser should stay abc.de

Some examples:

  • abc.de/test -> example.com/test
  • abc.de/ab?query=string -> example.com/ab?query=string

I already tried the following configuration, but I'm getting 500 server errors.

RewriteEngine on
RewriteRule ^/(.*) http://example.com/$1 [P]
ProxyPassReverse  / http://example.com/
  • `ProxyPass ` abd `ProxyPassReverse` aren't allowed in .htaccess. Have you enabled `mod_proxy` in Apache config? – anubhava Feb 03 '21 at 18:37
  • have to check. good point thanks – PhilSchneider Feb 03 '21 at 18:40
  • "different domain" - on a different server? You can't "rewrite" the URL to a different domain. If you do need to internally forward the request to a "different domain" then you need to configure your server as a _reverse proxy_ and proxy the request. Ideally, this should be done in the server config, not `.htaccess`. – MrWhite Feb 03 '21 at 22:38

0 Answers0