# HTTP auf HTTPS umleiten, außer ein Pfad

**URL:** <https://forum.shopware.com/t/http-auf-https-umleiten-ausser-ein-pfad/44991>\
**Category:** Allgemein\
**Created:** [3. April 2017 um 20:26 UTC](https://forum.shopware.com/t/http-auf-https-umleiten-ausser-ein-pfad/44991 "2017-04-03T20:26:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![konsi](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@konsi](https://forum.shopware.com/u/konsi)\
**Post date:** [3. April 2017 um 20:26 UTC](https://forum.shopware.com/t/http-auf-https-umleiten-ausser-ein-pfad/44991/1 "2017-04-03T20:26:08Z")

</div>

Hallo, ich möchte per .htaccess alle URL´s von http auf https umleiten, was auch nicht das Problem ist.

Leider habe ich eine Shopseite, die kein https haben darf. Sobald ich “RewriteCond %{HTTPS} off” mache, funktioniert “RewriteRule ^sendungsverfolgung$ [http://domain.de/sendungsverfolgung](http://domain.de/sendungsverfolgung) [L,R=301]” nicht mehr… was auch irgendwie logisch ist.

Kann mir einer sagen wie ich das hinbekommen könnte? Ich finde einfach nichts dazu -\_-

---

<div class="post-metadata">

**Author:** ![sonic](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sonic/32/25728_2.png) [@sonic](https://forum.shopware.com/u/sonic)\
**Post date:** [3. April 2017 um 20:42 UTC](https://forum.shopware.com/t/http-auf-https-umleiten-ausser-ein-pfad/44991/2 "2017-04-03T20:42:07Z")

</div>

Aus dem Bauch raus: die Umleitung auf https mit einer weiteren RewriteCond auf „ungleich“&nbsp;^sendungsverfolgung$ &nbsp;testen.

In etwa&nbsp;so:

```
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !(sendungsverfolgung$)
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteRule ^sendungsverfolgung$ http://domain.de/sendungsverfolgung [L,R=301]

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![konsi](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@konsi](https://forum.shopware.com/u/konsi)\
**Post date:** [3. April 2017 um 20:51 UTC](https://forum.shopware.com/t/http-auf-https-umleiten-ausser-ein-pfad/44991/3 "2017-04-03T20:51:08Z")

</div>

wenn ich es mit off mache, funktioniert alles, mit !=on aber nicht… wenn ich die Umleitung prüfe, kommt allerdings weiterhin 200 und nicht 301…

&nbsp;

```
RewriteEngine on

#RewriteBase /shopware/

# Https config for the backend
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} (^sendungsverfolgung$)
#RewriteRule backend/(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^sendungsverfolgung$ http://domain.de/sendungsverfolgung [L,R=301]

RewriteRule shopware.dll shopware.php
RewriteRule files/documents/.* engine [NC,L]
RewriteRule backend/media/(.*) media/$1 [NC,L]

RewriteCond %{REQUEST_URI} !(\/(engine|files|templates)\/)
RewriteCond %{REQUEST_URI} !(\/media\/(archive|banner|image|music|pdf|unknown|video)\/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ shopware.php [PT,L,QSA]

# Fix missing authorization-header on fast_cgi installations
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

# Staging-Rules start
#SetEnvIf Host "staging.test.shopware.in" ENV=staging

DirectoryIndex index.html
DirectoryIndex index.php
DirectoryIndex shopware.php

# Disables download of configuration

    Deny from all

# Enable gzip compression
#
# AddOutputFilterByType DEFLATE text/html text/xml text/plain text/css text/javascript application/json
#

AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
AddOutputFilterByType DEFLATE font/truetype font/opentype

    ExpiresActive on
    ExpiresDefault "access plus 1 month"
    FileETag None
    
        Header append Cache-Control "public"
        Header unset ETag
    

# Disables auto directory index

	Options -Indexes

    Options -MultiViews

# php_value memory_limit 128M
  php_value max_execution_time 120
# php_value upload_max_filesize 20M
   php_flag phar.readonly off
   php_flag magic_quotes_gpc off
   php_flag session.auto_start off
   php_flag suhosin.session.cryptua off
   php_flag zend.ze1_compatibility_mode off

# AddType x-mapp-php5 .php
# AddHandler x-mapp-php5 .php

```

ich versteh gar nichts mehr -\_-

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [3. April 2017 um 23:26 UTC](https://forum.shopware.com/t/http-auf-https-umleiten-ausser-ein-pfad/44991/4 "2017-04-03T23:26:51Z")

</div>

Wenn ich mich nicht irre, stoppt nach deinem Beispiel ein Matching&nbsp;nach (.\*), weil es als Last markiert ist. “[domain.de](http://domain.de)” müsste da auch ausgetauscht werden.

```
RewriteCond %{HTTPS} off
RewriteRule ^sendungsverfolgung http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![konsi](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@konsi](https://forum.shopware.com/u/konsi)\
**Post date:** [4. April 2017 um 09:06 UTC](https://forum.shopware.com/t/http-auf-https-umleiten-ausser-ein-pfad/44991/5 "2017-04-04T09:06:02Z")

</div>

Klappt leider immer noch nicht ☹
