# Routing durcheinander, Hilfe bei der htaccess gesucht

**URL:** <https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509>\
**Category:** Installation / Einstieg\
**Created:** [21. Juli 2020 um 15:58 UTC](https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509 "2020-07-21T15:58:13Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikosLMS](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nikosLMS](https://forum.shopware.com/u/nikosLMS)\
**Post date:** [21. Juli 2020 um 15:58 UTC](https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509/1 "2020-07-21T15:58:13Z")

</div>

&nbsp;

**UPDATE: Der Shop bzw. das Frontend funktioniert weiterhin nicht mit dem Zusatz „www“ in der Domain. Alles andere ist sowohl mit und ohne www zugänglich.**

&nbsp;

Hallo Leute,

ich habe Shopware 6 installiert und habe nun ein kleines Problem mit der Erreichbarkeit. Folgendes:

**ohne „www“**

Frontend: [https://meinedomain.de](https://meinedomain.de)

Frontend: [https://meinedomain.de/public](https://meinedomain.de/public)

Backend: [https://meinedomain.de/admin](https://meinedomain.de/admin)

&nbsp;

**mit „www“**

Frontend: [https://www.meinedomain.de](https://www.meinedomain.de)

Frontend: [https://www.meinedomain.de/public](https://www.meinedomain.de/public)

Backend: [https://www.meinedomain.de/admin](https://www.meinedomain.de/admin)

&nbsp;

&nbsp;

Das Backend funktioniert in allen Varianten aber das Frontend leider nur mit einer Schreibweise. Ich habe über Plesk (Obsidian 18.0.28 Update Nr. 3) auch schon bei den Hostingeinstellungen „httpdocs/public“ gesetzt aber auch schon diverse andere Varianten ausprobiert.

&nbsp;

In meiner htaccess in Basisverzeichnis/httpdocs/public konnte ich nichts mit „#RewriteBase /Shopware“ finden was ich hätte abändern können.

Hier meine htaccess:

&nbsp;

> DirectoryIndex index.php
> 
> Options -MultiViews
> 
> RewriteEngine On
> 
> &nbsp;&nbsp;&nbsp; RewriteCond %{REQUEST\_URI}::$1 ^(/.+)/(.\*)::\2$  
> &nbsp;&nbsp;&nbsp; RewriteRule ^(.\*) - [E=BASE:%1]
> 
> &nbsp;&nbsp;&nbsp; # Sets the HTTP\_AUTHORIZATION header removed by Apache  
> &nbsp;&nbsp;&nbsp; RewriteCond %{HTTP:Authorization} .  
> &nbsp;&nbsp;&nbsp; RewriteRule ^ - [E=HTTP\_AUTHORIZATION:%{HTTP:Authorization}]
> 
> &nbsp;&nbsp;&nbsp; RewriteCond %{ENV:REDIRECT\_STATUS} ^$  
> &nbsp;&nbsp;&nbsp; RewriteRule ^index.php(?:/(.\*)|$) %{ENV:BASE}/$1 [R=301,L]
> 
> &nbsp;&nbsp;&nbsp; # If the requested filename exists, simply serve it.  
> &nbsp;&nbsp;&nbsp; # We only want to let Apache serve files and not directories.  
> &nbsp;&nbsp;&nbsp; RewriteCond %{REQUEST\_FILENAME} -f  
> &nbsp;&nbsp;&nbsp; RewriteRule ^ - [L]
> 
> &nbsp;&nbsp;&nbsp; # Rewrite all other queries to the front controller.  
> &nbsp;&nbsp;&nbsp; RewriteRule ^ %{ENV:BASE}/index.php [L]
> 
> RedirectMatch 302 ^/$ /index.php/
> 
> Header set Content-Security-Policy „script-src ‚none‘“

&nbsp;

Gleiches gilt für die htaccess Datein in /update und /install:

**/ httpdocs / public / recovery / install / .htaccess:**

&nbsp;

> RewriteEngine On
> 
> &nbsp;&nbsp;&nbsp; RewriteRule .\* - [E=MOD\_REWRITE:1]  
> &nbsp;&nbsp;&nbsp; RewriteCond %{REQUEST\_FILENAME} !-f  
> &nbsp;&nbsp;&nbsp; RewriteRule ^(.\*)$ index.php [QSA,L]
> 
> &nbsp;&nbsp;&nbsp; # Set REQUEST\_SCHEME (standard environment variable in Apache 2.4)  
> &nbsp;&nbsp;&nbsp; RewriteCond %{HTTPS} off  
> &nbsp;&nbsp;&nbsp; RewriteRule .\* - [E=REQUEST\_SCHEME:http]
> 
> &nbsp;&nbsp;&nbsp; RewriteCond %{HTTPS} on  
> &nbsp;&nbsp;&nbsp; RewriteRule .\* - [E=REQUEST\_SCHEME:https]
> 
> DirectoryIndex index.php

**/ httpdocs / public / recovery / update / .htaccess:**

&nbsp;

> RewriteEngine On  
>   
> RewriteRule .\* - [E=MOD\_REWRITE:1]  
>   
> RewriteCond %{REQUEST\_FILENAME} !-f  
>   
> RewriteRule ^(.\*)$ index.php [QSA,L]
> 
> DirectoryIndex index.php

&nbsp;

Es wäre klasse, wenn das Frontent mit und auch ohne „www“ und auch ohne /public erreichbar wäre.

Shopware ist aktualisiert (Version: 6.2.3)

Hier noch die Fehler der Log Datei:httpdocs / var / log / prod-2020-07-21.log&nbsp; (Die Duplikate habe ich entfernt)

&nbsp;

> [2020-07-21 11:46:21] php.CRITICAL: Uncaught Error: Call to a member function getSource() on null {„exception“:„[object] (Error(code: 0): Call to a member function getSource() on null at /var/www/vhosts/meinedomain.de/httpdocs/vendor/shopware/core/Framework/Routing/ApiRouteScope.php:25)“}   
> [2020-07-21 11:46:21] request.CRITICAL: Uncaught PHP Exception Error: „Call to a member function getSource() on null“ at /var/www/vhosts/meinedomain.de/httpdocs/vendor/shopware/core/Framework/Routing/ApiRouteScope.php line 25 {„exception“:„[object] (Error(code: 0): Call to a member function getSource() on null at /var/www/vhosts/meinedomain.de/httpdocs/vendor/shopware/core/Framework/Routing/ApiRouteScope.php:25)“}   
> [2020-07-21 11:48:38] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: „No route found for „GET /recovery/common/assets/styles/icons.css“ (from „[https://meinedomain.de/„)“](https://meinedomain.de/%22)%22) at /var/www/vhosts/meinedomain.de/httpdocs/vendor/symfony/http-kernel/EventListener/RouterListener.php line 136 {„exception“:“[object] (Symfony\Component\HttpKernel\Exception\NotFoundHttpException(code: 0): No route found for "GET /recovery/common/assets/styles/icons.css" (from "[https://meinedomain.de/\](https://meinedomain.de/%5C)“) at /var/www/vhosts/meinedomain.de/httpdocs/vendor/symfony/http-kernel/EventListener/RouterListener.php:136, Symfony\Component\Routing\Exception\ResourceNotFoundException(code: 0): No routes found for "/recovery/common/assets/styles/icons.css/". at /var/www/vhosts/meinedomain.de/httpdocs/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php:70)„}   
> [2020-07-21 13:31:19] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: „No route found for „GET /recovery/common/assets/images/sw-logo-blue.svg“ (from „[https://meinedomain.de/„)“](https://meinedomain.de/%22)%22) at /var/www/vhosts/meinedomain.de/httpdocs/vendor/symfony/http-kernel/EventListener/RouterListener.php line 136 {„exception“:“[object] (Symfony\Component\HttpKernel\Exception\NotFoundHttpException(code: 0): No route found for "GET /recovery/common/assets/images/sw-logo-blue.svg" (from "[https://meinedomain.de/\](https://meinedomain.de/%5C)“) at /var/www/vhosts/meinedomain.de/httpdocs/vendor/symfony/http-kernel/EventListener/RouterListener.php:136, Symfony\Component\Routing\Exception\ResourceNotFoundException(code: 0): No routes found for "/recovery/common/assets/images/sw-logo-blue.svg/". at /var/www/vhosts/meinedomain.de/httpdocs/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php:70)“}   
> [2020-07-21 13:38:51] php.CRITICAL: Fatal Compile Error: require(): Failed opening required ‚/var/www/vhosts/meinedomain.de/httpdocs/var/cache/prod\_h2af4ecfeeae2de07197c20ad562393d3/Container62kVSj8/removed-ids.php‘ (include\_path=‚.:/opt/plesk/php/7.4/share/pear‘) {„exception“:„[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Compile Error: require(): Failed opening required ‚/var/www/vhosts/meinedomain.de/httpdocs/var/cache/prod\_h2af4ecfeeae2de07197c20ad562393d3/Container62kVSj8/removed-ids.php‘ (include\_path=‚.:/opt/plesk/php/7.4/share/pear‘) at /var/www/vhosts/meinedomain.de/httpdocs/var/cache/prod\_h2af4ecfeeae2de07197c20ad562393d3/Container62kVSj8/srcShopware\_Production\_KernelProdContainer.php:1365)“}

&nbsp;

Ich bin leider komplett in diesem Thema und kenn mich gar nicht mit solchen Sachen aus aber versuche mir durch Shopware soviel wie möglich selbst beizubringen. Ich bin über jede Hilfe dankbar! 🙂

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![SCOOPEX](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/scoopex/32/18328_2.png) [@SCOOPEX](https://forum.shopware.com/u/SCOOPEX)\
**Post date:** [21. Juli 2020 um 16:18 UTC](https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509/2 "2020-07-21T16:18:45Z")

</div>

Hallo,

offenbar verwendest Du Plesk als Admin-Panel.

Du musst die Shopware Daten in Dein /httpdocs Verzeichnis kopieren - unter „Hosting Einstellungen“ legst Du als Einstiegspunkt für Deine Domain /httpdocs/public fest und bei bevorzugte Domain-Schreibweise muss KEINE stehen.

An der .htaccess sind keine Änderungen erforderlich.

Viele Grüße

---

<div class="post-metadata">

**Author:** ![nikosLMS](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nikosLMS](https://forum.shopware.com/u/nikosLMS)\
**Post date:** [21. Juli 2020 um 18:02 UTC](https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509/3 "2020-07-21T18:02:51Z")

</div>

Hi,

Danke für deine Antwort!&nbsp;

ja ich nutze Plesk als CPanel, wurde mir als totaler Anfänger was Serververwaltung angeht empfohlen. Ich hatte vorher die Installation in einem Unterordner in /httpdocs. Der vorherige Pfad war /httpdocs/shopware und dort waren die Datein aber das hatte auch nicht funktioniert. Im Forum stand, dass die Datein zwingend im Hauptordner liegen müssen. Kann ich die Datein ganz einfach in /httpdocs verschieben oder muss ich Shopware neu installieren?

&nbsp;

---

<div class="post-metadata">

**Author:** ![SCOOPEX](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/scoopex/32/18328_2.png) [@SCOOPEX](https://forum.shopware.com/u/SCOOPEX)\
**Post date:** [21. Juli 2020 um 18:05 UTC](https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509/4 "2020-07-21T18:05:55Z")

</div>

Hallo,

nein Du kannst auch als Einstiegspunkt unter „Hosting Einstellungen“ dann entsprechend /httpdocs/shopware/public eintragen. Wichtig ist nur, dass die Shopware Dateien inkl. dem public Verzeichnis in dem entsprechenden Zielverzeichnis (also dem Einstiegspunkt) liegen und keine bevorzugte Domain-Schreibweise unter Hosting-Einstellungen eingetragen ist.

Viele Grüße

---

<div class="post-metadata">

**Author:** ![nikosLMS](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nikosLMS](https://forum.shopware.com/u/nikosLMS)\
**Post date:** [22. Juli 2020 um 07:45 UTC](https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509/5 "2020-07-22T07:45:36Z")

</div>

Moin Scoopex,

ich habe jetzt noch einmal alles geprüft. Die ganzen Datein liegen in httpdocs und das Zielverzeichnis bei Plesk ist /httpdocs/public

Es hat sich aber nichts geändert. Irgendwo muss ja noch ein Fehler sein ☹

---

<div class="post-metadata">

**Author:** ![SCOOPEX](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/scoopex/32/18328_2.png) [@SCOOPEX](https://forum.shopware.com/u/SCOOPEX)\
**Post date:** [22. Juli 2020 um 08:48 UTC](https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509/6 "2020-07-22T08:48:41Z")

</div>

Hallo,

in welchem Verzeichnis liegen denn Deine Shopware Daten ? Liegt public im /httpdocs Verzeichnis oder wie Du geschrieben hast, unter /httpdocs/shopware/ ?

Falls in letzterem, musst Du den Einstiegspunkt auf /httpdocs/shopware/public setzen.

Viele Grüße

---

<div class="post-metadata">

**Author:** ![nikosLMS](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nikosLMS](https://forum.shopware.com/u/nikosLMS)\
**Post date:** [24. Juli 2020 um 10:53 UTC](https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509/7 "2020-07-24T10:53:54Z")

</div>

Moin Scoopex,

alle Daten sind im /httpdocs Ordner. ich hatte die Installation früher in einem Unterverzeichnis nun aber nicht mehr.

Ich habe nun eine Neuinstallation gemacht, alles geupdatet und jetzt ist ein Fehler auch weg.

Ich erreiche den Shop/Frontend nun unter [https://meinedomain.de](https://meinedomain.de) aber nicht mit https:// **www.** [meinedomain.de](http://meinedomain.de)

Das Backend ist sowohl mit als auch ohne **www** zu erreichen.

Ich muss den Shop also nur noch mit „www“ hinbekommen.

Viele Grüße

---

<div class="post-metadata">

**Author:** ![Xali](https://avatars.discourse-cdn.com/v4/letter/x/ce7236/32.png) [@Xali](https://forum.shopware.com/u/Xali)\
**Post date:** [24. Juli 2020 um 11:42 UTC](https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509/8 "2020-07-24T11:42:52Z")

</div>

wieso willst du die Seite sowohl unter [www.domain.de](http://www.domain.de) und [domain.de](http://domain.de) betreiben ?

Das macht alles nur unnötig kompliziert. Erstelle einfach eine entsprechende Rewrite Rule die [www.domain.de](http://www.domain.de) auf [domain.de](http://domain.de) umbiegt. Direkt in der Konfiguration vom Webserver.

Beispiel für nginx :

&nbsp;

if ($host = [www.meinesexydomain.de](http://www.meinesexydomain.de)) {  
rewrite ^ https://meinesexydomain.de$request\_uri? permanent;  
}  
&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![SCOOPEX](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/scoopex/32/18328_2.png) [@SCOOPEX](https://forum.shopware.com/u/SCOOPEX)\
**Post date:** [24. Juli 2020 um 11:48 UTC](https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509/9 "2020-07-24T11:48:50Z")

</div>

Hallo,

ist unter „Hosting Einstellungen“ die bevorzugte Domainschreibweise auf KEINE gesetzt ? Auch darauf achten, dass die automatische Umleitung auf SSL dort deaktiviert ist - die Steuerung übernimmt Shopware.

Viele Grüße

---

<div class="post-metadata">

**Author:** ![nikosLMS](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nikosLMS](https://forum.shopware.com/u/nikosLMS)\
**Post date:** [24. Juli 2020 um 11:51 UTC](https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509/10 "2020-07-24T11:51:29Z")

</div>

Ja, bei den Hostingeinstellungen habe ich die Bevorzugte Domain auf “keine”

---

<div class="post-metadata">

**Author:** ![SCOOPEX](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/scoopex/32/18328_2.png) [@SCOOPEX](https://forum.shopware.com/u/SCOOPEX)\
**Post date:** [24. Juli 2020 um 12:29 UTC](https://forum.shopware.com/t/routing-durcheinander-hilfe-bei-der-htaccess-gesucht/68509/11 "2020-07-24T12:29:42Z")

</div>

Automatische Weiterleitung auf SSL unter Hosting-Einstellungen auch deaktiviert?

Einen www. Alias für Deine Domain hast Du aber, den Du auch anpingen kannst ?

Viele Grüße
