Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] how to redirct to another domain only with matched string in regex parentheses #2744

Closed
CoolRice opened this issue Sep 11, 2019 · 1 comment

Comments

@CoolRice
Copy link

@CoolRice CoolRice commented Sep 11, 2019

I want redirct http://localhost/somePath/xxxxxxx => http://www.example.com/xxxxxxx.

tried

redir {
    if {path} match ^/somePath/(.*)
    / http://www.example.com{uri}
}

and

localhost:80/somePath/ {
	redir / https://www.example.com/{uri}
}

They all take the page to https://www.example.com/somePath/xxxxxxx

expected: http://www.example.com/xxxxxxx
platform: windows 10
caddy version: 1.0.3

Anyone can help?

@CoolRice CoolRice changed the title [question] how to redirct to another domain only with matched string regex parentheses [question] how to redirct to another domain only with matched string in regex parentheses Sep 11, 2019
@mholt

This comment has been minimized.

Copy link
Member

@mholt mholt commented Sep 11, 2019

Thanks for your question, and I'm thrilled that you're using Caddy! This looks more like a question about how to use Caddy rather than a bug report or feature request. Since this issue tracker is reserved for specific, development-focused discussions, I'm going to close this, but we have a community forum where more people will be exposed to your question, including people who may be more expert or experienced with the specific question you're facing. I hope you'll ask your question there, and thanks for understanding!

@mholt mholt closed this Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.