How to best clone WordPress for testing (using Fiddler to redirect)

Question

I got my local setup working at IP 127.0.0.1:91/blog

In order to overwrite my server default domain I added locally this to my wp-config.php file:

define('WP_HOME','http://127.0.0.1:91/blog');
define('WP_SITEURL','http://127.0.0.1:91/blog');
define('FORCE_SSL_LOGIN',false);
define('FORCE_SSL_ADMIN',false);

In my Fiddler Web Debugger script I am using the following code to redirect my browser to instead go to my local setup:

if (oSession.HostnameIs("my.domain.name")){
    oSession.bypassGateway = true;
    if (oSession.HTTPMethodIs("CONNECT")){
        oSession["x-replywithtunnel"] = "FakeTunnel";
        return;
    }  
    oSession["x-overrideHost"] = "127.0.0.1:91";
    oSession.fullUrl = "http://127.0.0.1:91" + oSession.PathAndQuery;
}

For now, if I check WP on http://127.0.0.1:91/blog/wp-login.php all is working. But when logging in using https://my.domain.name/blog/wp-login.php it bumps me back out to http://127.0.0.1:91/blog/wp-login.php. How can I stay on https://my.domain.name/blog/wp-login.php –OR–

How can I get WordPress returned page to be rewritten before it gets sent do the browser from 127.0.0.1:91 to my.domain.name; and from http:// to https://?

— Or — is there a smarter way to go about all of this within WordPress?

I tried this in my Fiddler Script but it is not working:

if oSession.oResponse.headers.ExistsAndContains("Content-Type","text/html")){
    oSession.utilDecodeResponse();
    oSession.utilReplaceInResponse('http://','https://');
    oSession.utilReplaceInResponse('127.0.0.1:91','my.domain.name');
}

I also tried an Apache proxy rewrite but that too is jumping out of the proxy.

0
MeSo2 4 months 0 Answers 9 views 0

Leave an answer