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;








0















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?










share|improve this question






















  • 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

















0















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?










share|improve this question






















  • 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













0












0








0








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?










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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

















  • 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










2 Answers
2






active

oldest

votes


















0














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"
)





share|improve this answer























  • 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


















-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" )







share|improve this answer

























  • .* 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











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
);



);













draft saved

draft discarded


















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









0














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"
)





share|improve this answer























  • 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















0














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"
)





share|improve this answer























  • 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













0












0








0







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"
)





share|improve this answer













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"
)






share|improve this answer












share|improve this answer



share|improve this answer










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

















  • 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













-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" )







share|improve this answer

























  • .* 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















-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" )







share|improve this answer

























  • .* 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













-1












-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" )







share|improve this answer















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" )








share|improve this answer














share|improve this answer



share|improve this answer








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

















  • .* 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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

Why did Thanos need his ship to help him in the battle scene?Which actor plays Thanos in the Avengers mid-credits scene?Are there economic implications portrayed in comics where the buildings and cities are ruined almost daily?Old X-Men comic where team travels to alien world with a ring-like sun that needs recharging?Why does Ego need help sleeping?Is there an objective answer to who “the strongest Avenger” is?How did Banner get unstuck?Why did Thanos get hit?How did Thanos (or anyone) know the Infinity Stones would give him this power?Did Thanos leave Eitri alive for his after-sales service?In Avengers 1, why does Thanos need Loki?