N
N
Ninazu2018-08-20 16:35:32
htaccess
Ninazu, 2018-08-20 16:35:32

How to make a redirect with BasicAuth?

How to use local .htaccess to set up a redirect for a specific file that requires basic authorization? That is, let's say there is a test.php
file on a third-party server dev.test.com that requires a header with Authorization: Basic . And there is a local site that connects this file but takes it from a remote server and not locally. redirect do this

RewriteCond %{REQUEST_URI} ^/test.php$
RewriteRule (.*) https://dev.test.com/test.php [R=302,L,NE]

But in the end, the request to the remote server leaves without a header, and it falls off after authorization. How to fix this miracle?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2018-08-20
@dodo512

RewriteRule ^(test\.php)$ https://username:[email protected]/$1 [R=302,L,NE]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question