Jump to content
Froxlor Forum
  • 0

Non www to www mit https


Question

Ich habe auf meinem Servre Nginx laufen, daher schon helfen mir .htaccess Lösungen leider nicht.

Ich möchte, dass alle Aufrufe auf https://www.domain.de geleitet werden. Singemäß natürlich auch für die Unterseiten.

Aktuell funktioniert bei mir nur die weiterheitung auf https mit folgender Konfiguration:

location @php {
   fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}

if ($scheme = http) {
   return 301 https://www.$server_name$request_uri;
}

location ~*  \.(jpg|jpeg|png|gif|ico|css|js|svg|mp4|ttf|otf|woff|woff2|eot|swf|pdf)(\?ver=[0-9.]+)?$ {
   expires 30d;
   add_header Pragma public;
   add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}

location / { 
   rewrite kontakt-anfrage /kontakt permanent;
   rewrite /typo3/preise/hochzeit/hochzeitsfotos /privatkunden/hochzeitsfotografie permanent;
   rewrite /preise/hochzeit/hochzeitsfotos /privatkunden/hochzeitsfotografie permanent;
   rewrite /foto-galerie/personen/frauen /freie-galerie/personen permanent;
   rewrite /preis-leistung/hochzeit /privatkunden/hochzeitsfotografie permanent;

# Generiert von https://donatstudios.com/RewriteRule_Generator
rewrite ^/ablauf/$ /shooting-tipps/ablauf/? permanent;
rewrite ^/agb/$ /ueber-uns/agb/? permanent;
rewrite ^/agb$ /ueber-uns/agb/? permanent;
rewrite ^/anfrage/$ /kontakt/? permanent;
rewrite ^/datenschutz/$ /ueber-uns/datenschutz/? permanent;
rewrite ^/fileadmin/formulare/Preisliste\.pdf$ /? permanent;
rewrite ^/haftungsausschluss/$ /ueber-uns/haftungsausschluss? permanent;
rewrite ^/preis-leistung/baby-und-schwangerschaft/babyfotos/$ /privatkunden/baby-und-schwangerschaft/babyfotos/? permanent;
rewrite ^/preis-leistung/baby-und-schwangerschaft/schwangerschaftsfotos/$ /privatkunden/baby-und-schwangerschaft/schwangerschaftsfotos/? permanent;
rewrite ^/preis-leistung/baby-und-schwangerschaft/schwangerschaftsfotos/1/$ /privatkunden/baby-und-schwangerschaft/schwangerschaftsfotos/? permanent;
rewrite ^/preis-leistung/baby-und-schwangerschaft/schwangerschaftsfotos/1/1/$ /privatkunden/baby-und-schwangerschaft/schwangerschaftsfotos/? permanent;
rewrite ^/preis-leistung/biometrische-passfotos/$ /privatkunden/biometrische-passfotos/? permanent;
rewrite ^/preis-leistung/einzel-und-paar-shooting/$ /privatkunden/einzel-und-paar-shooting/? permanent;
rewrite ^/preis-leistung/familien/$ /privatkunden/familien/? permanent;
rewrite ^/preis-leistung/fotokalender-als-weihnachtsgeschenk/$ /privatkunden/fotokalender-als-weihnachtsgeschenk/? permanent;
rewrite ^/preis-leistung/fotokurse/$ /privatkunden/fotokurse/? permanent;
rewrite ^/preis-leistung/individuelles-shooting/$ /privatkunden/individuelles-shooting/? permanent;
rewrite ^/preis-leistung/paar-freundschaft-shootings/$ /privatkunden/paar-freundschaft-shootings/? permanent;
rewrite ^/preis-leistung/spezial-shootings/$ /privatkunden/spezial-shootings/? permanent;
rewrite ^/preis-leistung/spezial-shootings/extreme-makeup-shooting/$ /privatkunden/spezial-shootings/extreme-makeup-shooting/? permanent;
rewrite ^/preis-leistung/spezial-shootings/regenshooting/$ /privatkunden/spezial-shootings/regenshooting/? permanent;
rewrite ^/preis-leistung/taufe-kommunion/$ /privatkunden/taufe-kommunion/? permanent;
rewrite ^/preis-leistung/tier-haustier-fotografien/$ /privatkunden/tier-haustier-fotografien/? permanent;
rewrite ^/preis-leistung/valentinstags-geschenk/$ /privatkunden/valentinstags-geschenk/? permanent;
rewrite ^/preis-leistung/weihnachts-shooting/$ /privatkunden/weihnachts-shooting/? permanent;
rewrite ^/privatkunden/baby-und-schwangerschaft/schwangerschaftsfotos/1/$ /privatkunden/baby-und-schwangerschaft/schwangerschaftsfotos/? permanent;
rewrite ^/privatkunden/baby-und-schwangerschaft/schwangerschaftsfotos/1/1/$ /privatkunden/baby-und-schwangerschaft/schwangerschaftsfotos/? permanent;
rewrite ^/privatkunden/foto-shootings/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/privatkunden/fotoshootings/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/privatkunden/fotokalender-als-weihnachtsgeschenk/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/privatkunden/hochzeit/fotos-detailaufnahmen/$ /privatkunden/hochzeit/fotos-detailaufnahmen/? permanent;
rewrite ^/privatkunden/hochzeit/fotos-feier/$ /privatkunden/hochzeitsfotografie/fotos-feier/? permanent;
rewrite ^/privatkunden/hochzeit/fotos-kirche/$ /privatkunden/hochzeitsfotografie/fotos-kirche/? permanent;
rewrite ^/privatkunden/hochzeit/fotos-park-modern/$ /privatkunden/hochzeitsfotografie/fotos-park-modern/? permanent;
rewrite ^/privatkunden/hochzeit/fotos-standesamt/$ /privatkunden/hochzeitsfotografie/fotos-standesamt/? permanent;
rewrite ^/privatkunden/hochzeit/fotos-studio/$ /privatkunden/hochzeitsfotografie/fotos-studio/? permanent;
rewrite ^/privatkunden/hochzeit/hochzeits-fotobuecher/$ /privatkunden/hochzeitsfotografie/hochzeits-fotobuecher/? permanent;
rewrite ^/privatkunden/hochzeit/hochzeitsfotos-1/$ /privatkunden/hochzeitsfotografie/fotos-park-modern/? permanent;
rewrite ^/privatkunden/hochzeit/hochzeitsfotos-3/$ /privatkunden/hochzeitsfotografie/fotos-park-modern/? permanent;
rewrite ^/privatkunden/hochzeit/hochzeitsfotos-4/$ /privatkunden/hochzeitsfotografie/fotos-park-modern/? permanent;
rewrite ^/privatkunden/hochzeitsfotografie/fotos-kirche/1/1/$ /privatkunden/hochzeitsfotografie/fotos-kirche/? permanent;
rewrite ^/privatkunden/hochzeitsfotografie/fotos-park/1/$ /privatkunden/hochzeitsfotografie/fotos-park/? permanent;
rewrite ^/privatkunden/hochzeitsfotografie/fotos-park/1/1/$ /privatkunden/hochzeitsfotografie/fotos-park/? permanent;
rewrite ^/privatkunden/hochzeitsfotografie/fotos-park/2/1/$ /privatkunden/hochzeitsfotografie/fotos-park/? permanent;
rewrite ^/privatkunden/hochzeitsfotografie/fotos-standesamt/1/$ /privatkunden/hochzeitsfotografie/fotos-standesamt/? permanent;
rewrite ^/privatkunden/hochzeitsfotografie/fotos-standesamt/1/1/$ /privatkunden/hochzeitsfotografie/fotos-standesamt/? permanent;
rewrite ^/privatkunden/paar-freundschaft-shootings/$ /privatkunden/paar-amp-freundschaft-shootings/? permanent;
rewrite ^/privatkunden/schueler-angebote/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/shooting-tipps/shooting-tipps-tricks/$ /shooting-tipps/shooting-tipps-amp-tricks/? permanent;
rewrite ^/shooting-tipps/tfp-tfcd-faq/bewerbung-tfp-shooting/$ /shooting-tipps/tfp-tfcd-faq/casting-bewerbung/? permanent;
rewrite ^/shooting/ablauf/$ /shooting-tipps/ablauf/? permanent;
rewrite ^/shooting/formulare/$ /shooting-tipps/formulare/? permanent;
rewrite ^/shooting/shooting-tipps-tricks/$ /shooting-tipps/shooting-tipps-tipps-tricks/? permanent;
rewrite ^/shooting-tipps/tfp-tfcd-faq/casting-bewerbung/$ /privatkunden/shooting-tipps/casting-bewerbung/? permanent;
rewrite ^/shooting/stilrichtung/$ /shooting-tipps/stilrichtung/? permanent;
rewrite ^/shooting/tfp-tfcd-faq/$ /shooting-tipps/tfp-tfcd-faq/? permanent;
rewrite ^/freie-galerie/personen/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/sitemap/$ /ueber-uns/sitemap? permanent;
rewrite ^/startseite/$ /? permanent;

#Rewrites nach Redesign Responsive
rewrite ^/freie-galerie/personen/erwachsene/katja/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/freie-galerie/personen/erwachsene/melissa/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/freie-galerie/personen/erwachsene/jessica/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/freie-galerie/personen/erwachsene/tina/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/freie-galerie/personen/erwachsene/mona/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/freie-galerie/personen/erwachsene/leelu/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/freie-galerie/personen/jugendliche/katrin/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/freie-galerie/personen/weibliche-modelle/lina/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/freie-galerie/personen/weibliche-modelle/tanja-s/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/freie-galerie/personen/weibliche-modelle/manuela/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/freie-galerie/personen/weibliche-modelle/lisa-g/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/freie-galerie/personen/weibliche-modelle/daniela/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/freie-galerie/personen/weibliche-modelle/$ /privatkunden/fotoshooting/? permanent;
rewrite ^/privatkunden/fotoshooting/galerie-akt/$ /privatkunden/spezial-shootings/erotik-shooting/? permanent;
rewrite ^/privatkunden/fotoshooting/galerie-dessous/$ /privatkunden/spezial-shootings/erotik-shooting/? permanent;
rewrite ^/privatkunden/hochzeitsfotografie/hochzeitsfotos-2/$ /privatkunden/hochzeitsfotografie/? permanent;
rewrite ^/privatkunden/hochzeitsfotografie/hochzeitsfotos-3/$ /privatkunden/hochzeitsfotografie/? permanent;
rewrite ^/privatkunden/hochzeitsfotografie/hochzeitsfotos-4/$ /privatkunden/hochzeitsfotografie/? permanent;
rewrite ^/ueber-uns/freie-galerie/sehenswertes/duesseldorf/kaiserpfalz-kaiserswerth/$ /ueber-uns/freie-galerie/sehenswertes/duesseldorf/submitFilter/ItemList/13/26/? permanent;
rewrite ^/ueber-uns/freie-galerie/sehenswertes/duesseldorf/schloss-benrath/$ /ueber-uns/freie-galerie/sehenswertes/duesseldorf/submitFilter/ItemList/13/27/? permanent;
rewrite ^/ueber-uns/freie-galerie/tiere/schaeferhund/$ /privatkunden/tier-fotografien/? permanent;
rewrite ^/ueber-uns/freie-galerie/tiere/schaeferhund/1/1/$ /privatkunden/tier-fotografien/? permanent;
}

 

Was muss ich ändern, damit die Aufrufe entsprechend funktionieren? Vermieden soll ein umleiten von http auf https auf www.

Danke im Voraus :)

 

Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0

AM sorry I had to translate your question to understand it.

If you speak english, I will be able to help.

You really need to at least understand Nginx .

 

Also your question isn't clear enough and is incomplete to me.

 

Kindly make things clearer to receive help.

Thanks

Link to post
Share on other sites
  • 0
17 hours ago, Pro-Webs said:

I'm using a nginx server, so .htaccess solutions will not work for me.

I want that all requests will be rewrite to https: //.www, i have only the vhosts in froxlor to use for it.

http://domain.de -> https://www.domain.de

http://www.domain.de -> https://www.domain.de

https://domain.de -> https://www.domain.de

www.domain.de -> https://www.domain.de

 

If I understand you rightly, you want url  e.g  http://google.com   to redirect to  https://www.google.com .

 

This is very simple and can be done directly via FROXLOR's web interface.

 

First, you need to activate SSL on FROXLOR

 

Firstly, we need to know if you already have FROXLOR running properly or you are yet to install FROXLOR.

You posting NGINX  styled vhosts file kind of confuses me.

Need to know the following

1.  Is FROXLOR already installed ?
2.  If FROXLOR is already installed, is FROXLOR running without issues or errors ?
3.  Do you have SSL enabled already ?
4.  What Linux Distro (e.g CentOS, Debian, Ubuntu, etc) are you running ?
5.  Anything else you can add

we need answers to the above to know where to get started.

If you want things faster, drop many more clues so we ask less questions OR  you send me your server login so I take a look BUT you need to know that you have got to trust me to begin with.

Bye for now

Link to post
Share on other sites
  • 0
9 minutes ago, Pro-Webs said:

Nope. The http to https redirect works with the configuration above.

I need a solution to redirect to www from non-www including https.

Look this site: https://www.digitale-fotografien.com/

You want to be redirected ever to https. But if you write https://digitale-fotografien.com/

You will not be redirected to www.

Okay

Now I get what you mean.

 SSL and https already working on your FROXLOR installation.

WWW.google.com is different from google.com

What are you looking for is Server Alias.

Hit's done via FROXLOR interface.

1. Log into FROXLOR as an admin
2. Go to Domains and click on the domain you want redirected. 
3. While editing the domain on Froxlor's interface, look for this text     ServerAlias value for the domain: It has a drop-down of where you can select either   WWW   or   Wildcard (*.domain.tld)   or No Alias .  Just select www
4. Also make sure WWW has an A record in your DNS so it works well.

Sorry not used to writing tutorials as am often always very busy to relax and type.

Hope this helps.

Link to post
Share on other sites
  • 0

First, a server alias is not the same as a forwarder. With an alias, the same site appears under both names, which is usually undesirable because it means duplicating content, here's where the additional www-forwarder comes in the game.

Second, the file can be made many lines shorter by replacing numbers with "\d" or a range like "[2-4]". For details, see the documentation here.

Possible solution:
1) Enable the 'www' or '*' alias and 'https forwarding' in the domain settings from the froxlor panel.
2 )In your configuration file add something like:

if ($host !~ ^www\.) {
   rewrite ^ https://www.$host$request_uri permanent;
}

 

Link to post
Share on other sites
  • 0
Am 25.8.2018 um 11:48 schrieb kingsley ezenwa:

Okay

Now I get what you mean.

 SSL and https already working on your FROXLOR installation.

WWW.google.com is different from google.com

What are you looking for is Server Alias.

Hit's done via FROXLOR interface.

1. Log into FROXLOR as an admin
2. Go to Domains and click on the domain you want redirected. 
3. While editing the domain on Froxlor's interface, look for this text     ServerAlias value for the domain: It has a drop-down of where you can select either   WWW   or   Wildcard (*.domain.tld)   or No Alias .  Just select www
4. Also make sure WWW has an A record in your DNS so it works well.


Sorry not used to writing tutorials as am often always very busy to relax and type. 

Hope this helps.

The alias was already set to www. so that's not the solution. http to https is working even when i doit via vhost config ;)

Link to post
Share on other sites
  • 0
Am 25.8.2018 um 19:33 schrieb Exploit:

First, a server alias is not the same as a forwarder. With an alias, the same site appears under both names, which is usually undesirable because it means duplicating content, here's where the additional www-forwarder comes in the game.

Second, the file can be made many lines shorter by replacing numbers with "\d" or a range like "[2-4]". For details, see the documentation here.

Possible solution:
1) Enable the 'www' or '*' alias and 'https forwarding' in the domain settings from the froxlor panel.
2 )In your configuration file add something like:


if ($host !~ ^www\.) {
   rewrite ^ https://www.$host$request_uri permanent;
}

 

Is it possible to prevent that i got now two 301 redirects on http://digitale-fotografien.com

 

301.jpg

Link to post
Share on other sites
  • 0
Am 29.8.2018 um 08:40 schrieb Exploit:

Then you need to disable the https redirect in froxlor and use the one that you already was using.

Okay i deactivated it an set this code in vHost conf.

if ($scheme = http) {
   return 301 https://www.$server_name$request_uri;
}

if ($host !~ ^www\.) {
   rewrite ^ https://www.$host$request_uri permanent;
}

Thanks ;)

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...