Redirection 301 with htaccess doubt

0

Is it possible to do the following redirection through htaccess with logical operators?

domain1 / whatever / file.php - > domain2 / foo / file.php

being a generic rule? ie for example to redirect all the images of a folder from one server to another maintaining the relative path?

More than with images I want to do it with API methods I want that when it's called an API method on one server, answer the other one

    
asked by Korzan 15.06.2018 в 18:08
source

1 answer

-1

You could add this in your htaccess rules files on server 1:

RewriteRule ^(.*)/(.*)$ http://otroservidor.com/$1/$2 [NC,R=302,L]

You can change it to 301. If you're already sure.

I hope I have supported you.

Greetings

    
answered by 17.11.2018 в 21:45