lighttpd - redirect everything to httpsIn Nginx, how can I rewrite all http requests to https while maintaining sub-domain?HTTPS redirects in nginxIIS 7.5 SSL RedirectIIS 7.0: unwanted automatic redirect to HTTPSnginx http -> https redirect adding extra comma with the host nameRedirect all subdomains to main domain with HTTPS without a wildcard cert (nginx)Avoid double redirect NGINXHow to redirect the root URL of parked domains, using a variableHTTP to HTTPS redirect with apache (not secure)HTTPS redirect, exclude script parameters from URL
Is there a term for someone whose preferred policies are a mix of Left and Right?
100-doors puzzle
What is the context for Napoleon's quote "[the Austrians] did not know the value of five minutes"?
Can an escape pod land on Earth from orbit and not be immediately detected?
What is the color associated with lukewarm?
Can an opamp have its own voltage regulator?
Threading data on TimeSeries
My players want to use called-shots on Strahd
Approach sick days in feedback meeting
What is wind "CALM"?
Is it a good security practice to force employees hide their employer to avoid being targeted?
Can an open source licence be revoked if it violates employer's IP?
How many possible starting positions are uniquely solvable for a nonogram puzzle?
Jam with honey & without pectin has a saucy consistency always
SQL Server has encountered occurences of I/O requests taking longer than 15 seconds
Nth term of Van Eck Sequence
Does PC weight have a mechanical effect?
Why not make one big CPU core?
What should I be aware of in buying second-hand sinks and toilets?
How do I become a better writer when I hate reading?
Converting 3x7 to a 1x7. Is it possible with only existing parts?
How long would it take for sucrose to undergo hydrolysis in boiling water?
Is there a risk to write an invitation letter for a stranger to obtain a Czech (Schengen) visa?
Reflecting Telescope Blind Spot?
lighttpd - redirect everything to https
In Nginx, how can I rewrite all http requests to https while maintaining sub-domain?HTTPS redirects in nginxIIS 7.5 SSL RedirectIIS 7.0: unwanted automatic redirect to HTTPSnginx http -> https redirect adding extra comma with the host nameRedirect all subdomains to main domain with HTTPS without a wildcard cert (nginx)Avoid double redirect NGINXHow to redirect the root URL of parked domains, using a variableHTTP to HTTPS redirect with apache (not secure)HTTPS redirect, exclude script parameters from URL
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have tried to use the example from this wiki page -
$HTTP["scheme"] == "http"
# capture vhost name with regex conditiona -> %0 in redirect pattern
# must be the most inner block to the redirect rule
$HTTP["host"] =~ ".*"
url.redirect = (".*" => "https://%0$0")
But when I enter this url -
http://www.domain.co.il/index.php?shop=amazon
I got redirected to
https://index.php/index.php?shop=amazon
What is the problem?
redirect https lighttpd
add a comment |
I have tried to use the example from this wiki page -
$HTTP["scheme"] == "http"
# capture vhost name with regex conditiona -> %0 in redirect pattern
# must be the most inner block to the redirect rule
$HTTP["host"] =~ ".*"
url.redirect = (".*" => "https://%0$0")
But when I enter this url -
http://www.domain.co.il/index.php?shop=amazon
I got redirected to
https://index.php/index.php?shop=amazon
What is the problem?
redirect https lighttpd
The example on the wiki page is fine; the question is how you tried to use it - maybe show us a larger part of your config.
– Stefan
Sep 14 '14 at 18:12
add a comment |
I have tried to use the example from this wiki page -
$HTTP["scheme"] == "http"
# capture vhost name with regex conditiona -> %0 in redirect pattern
# must be the most inner block to the redirect rule
$HTTP["host"] =~ ".*"
url.redirect = (".*" => "https://%0$0")
But when I enter this url -
http://www.domain.co.il/index.php?shop=amazon
I got redirected to
https://index.php/index.php?shop=amazon
What is the problem?
redirect https lighttpd
I have tried to use the example from this wiki page -
$HTTP["scheme"] == "http"
# capture vhost name with regex conditiona -> %0 in redirect pattern
# must be the most inner block to the redirect rule
$HTTP["host"] =~ ".*"
url.redirect = (".*" => "https://%0$0")
But when I enter this url -
http://www.domain.co.il/index.php?shop=amazon
I got redirected to
https://index.php/index.php?shop=amazon
What is the problem?
redirect https lighttpd
redirect https lighttpd
asked Sep 13 '14 at 18:05
dima_makdima_mak
706
706
The example on the wiki page is fine; the question is how you tried to use it - maybe show us a larger part of your config.
– Stefan
Sep 14 '14 at 18:12
add a comment |
The example on the wiki page is fine; the question is how you tried to use it - maybe show us a larger part of your config.
– Stefan
Sep 14 '14 at 18:12
The example on the wiki page is fine; the question is how you tried to use it - maybe show us a larger part of your config.
– Stefan
Sep 14 '14 at 18:12
The example on the wiki page is fine; the question is how you tried to use it - maybe show us a larger part of your config.
– Stefan
Sep 14 '14 at 18:12
add a comment |
2 Answers
2
active
oldest
votes
Everything works fine after removing this -
url.rewrite-once = ( "^/min/([a-z]=.*)" => "/min/index.php?$1",
"^(.*).(jpg|gif|woff|tff|png|js|css|html|htm|txt)(.*)$" => "$0",
"^/question2answer/(.+)$" => "/question2answer/index.php?qa-rewrite=$1",
"^/$" => "/index.php"
)
But is there a way to do so with addition redirecting to "www." if there is no "www." in host? May be I need to ask a new question?
– dima_mak
Sep 14 '14 at 18:30
add a comment |
This might not be the most elegant way, but it worked for us. Explicitly catches a regex match. (Note: maybe it should be "https://%1$1")
$SERVER["socket"] == ":80"
$HTTP["host"] =~ "^(.*)$"
url.redirect = ( "^/(.*)" => "https://%1/$1" )
.* matches by default the complete string (greedy match), and so %0 and $0 are perfectly fine. $SERVER also adds a socket bind, which usually isn't wanted - the scheme matching is the right way.
– Stefan
Sep 14 '14 at 18:11
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f628333%2flighttpd-redirect-everything-to-https%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Everything works fine after removing this -
url.rewrite-once = ( "^/min/([a-z]=.*)" => "/min/index.php?$1",
"^(.*).(jpg|gif|woff|tff|png|js|css|html|htm|txt)(.*)$" => "$0",
"^/question2answer/(.+)$" => "/question2answer/index.php?qa-rewrite=$1",
"^/$" => "/index.php"
)
But is there a way to do so with addition redirecting to "www." if there is no "www." in host? May be I need to ask a new question?
– dima_mak
Sep 14 '14 at 18:30
add a comment |
Everything works fine after removing this -
url.rewrite-once = ( "^/min/([a-z]=.*)" => "/min/index.php?$1",
"^(.*).(jpg|gif|woff|tff|png|js|css|html|htm|txt)(.*)$" => "$0",
"^/question2answer/(.+)$" => "/question2answer/index.php?qa-rewrite=$1",
"^/$" => "/index.php"
)
But is there a way to do so with addition redirecting to "www." if there is no "www." in host? May be I need to ask a new question?
– dima_mak
Sep 14 '14 at 18:30
add a comment |
Everything works fine after removing this -
url.rewrite-once = ( "^/min/([a-z]=.*)" => "/min/index.php?$1",
"^(.*).(jpg|gif|woff|tff|png|js|css|html|htm|txt)(.*)$" => "$0",
"^/question2answer/(.+)$" => "/question2answer/index.php?qa-rewrite=$1",
"^/$" => "/index.php"
)
Everything works fine after removing this -
url.rewrite-once = ( "^/min/([a-z]=.*)" => "/min/index.php?$1",
"^(.*).(jpg|gif|woff|tff|png|js|css|html|htm|txt)(.*)$" => "$0",
"^/question2answer/(.+)$" => "/question2answer/index.php?qa-rewrite=$1",
"^/$" => "/index.php"
)
answered Sep 14 '14 at 18:25
dima_makdima_mak
706
706
But is there a way to do so with addition redirecting to "www." if there is no "www." in host? May be I need to ask a new question?
– dima_mak
Sep 14 '14 at 18:30
add a comment |
But is there a way to do so with addition redirecting to "www." if there is no "www." in host? May be I need to ask a new question?
– dima_mak
Sep 14 '14 at 18:30
But is there a way to do so with addition redirecting to "www." if there is no "www." in host? May be I need to ask a new question?
– dima_mak
Sep 14 '14 at 18:30
But is there a way to do so with addition redirecting to "www." if there is no "www." in host? May be I need to ask a new question?
– dima_mak
Sep 14 '14 at 18:30
add a comment |
This might not be the most elegant way, but it worked for us. Explicitly catches a regex match. (Note: maybe it should be "https://%1$1")
$SERVER["socket"] == ":80"
$HTTP["host"] =~ "^(.*)$"
url.redirect = ( "^/(.*)" => "https://%1/$1" )
.* matches by default the complete string (greedy match), and so %0 and $0 are perfectly fine. $SERVER also adds a socket bind, which usually isn't wanted - the scheme matching is the right way.
– Stefan
Sep 14 '14 at 18:11
add a comment |
This might not be the most elegant way, but it worked for us. Explicitly catches a regex match. (Note: maybe it should be "https://%1$1")
$SERVER["socket"] == ":80"
$HTTP["host"] =~ "^(.*)$"
url.redirect = ( "^/(.*)" => "https://%1/$1" )
.* matches by default the complete string (greedy match), and so %0 and $0 are perfectly fine. $SERVER also adds a socket bind, which usually isn't wanted - the scheme matching is the right way.
– Stefan
Sep 14 '14 at 18:11
add a comment |
This might not be the most elegant way, but it worked for us. Explicitly catches a regex match. (Note: maybe it should be "https://%1$1")
$SERVER["socket"] == ":80"
$HTTP["host"] =~ "^(.*)$"
url.redirect = ( "^/(.*)" => "https://%1/$1" )
This might not be the most elegant way, but it worked for us. Explicitly catches a regex match. (Note: maybe it should be "https://%1$1")
$SERVER["socket"] == ":80"
$HTTP["host"] =~ "^(.*)$"
url.redirect = ( "^/(.*)" => "https://%1/$1" )
edited Sep 13 '14 at 21:10
answered Sep 13 '14 at 20:55
Nils ToedtmannNils Toedtmann
1,68421833
1,68421833
.* matches by default the complete string (greedy match), and so %0 and $0 are perfectly fine. $SERVER also adds a socket bind, which usually isn't wanted - the scheme matching is the right way.
– Stefan
Sep 14 '14 at 18:11
add a comment |
.* matches by default the complete string (greedy match), and so %0 and $0 are perfectly fine. $SERVER also adds a socket bind, which usually isn't wanted - the scheme matching is the right way.
– Stefan
Sep 14 '14 at 18:11
.* matches by default the complete string (greedy match), and so %0 and $0 are perfectly fine. $SERVER also adds a socket bind, which usually isn't wanted - the scheme matching is the right way.
– Stefan
Sep 14 '14 at 18:11
.* matches by default the complete string (greedy match), and so %0 and $0 are perfectly fine. $SERVER also adds a socket bind, which usually isn't wanted - the scheme matching is the right way.
– Stefan
Sep 14 '14 at 18:11
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f628333%2flighttpd-redirect-everything-to-https%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The example on the wiki page is fine; the question is how you tried to use it - maybe show us a larger part of your config.
– Stefan
Sep 14 '14 at 18:12