Post by Crafti1995 » Fri Nov 20, 2020 5:14 am

Guen Abend,

ich möchte meine Seite auf SEO URLs umstellen, jedoch kommt immer ein 500 Internal Server Error sobald ich die .htaccess Datei im Ordner habe. Aktuell liegt die .htaccess im Unterordner der Domain oc/shop. Muss die Datei in /oc oder in /shop? Was muss ich in der Datei ändern damit die SEO URLs funktionieren? mod_rewrite ist an.

Und der Inhalt sieht so aus:

Code: Select all

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directoy listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|.twig|\.ini|\.log|(?<!robots)\.txt))">
 Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# Order deny,allow
# Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteBase /oc/shop/
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200

# 7. disable open_basedir limitations
php_admin_value open_basedir none
Danke im Voraus.

MfG

Crafti1995

Edit: Die OpenCart Version ist die 3.0.3.6 und ich benutze die neueste Version von Plesk auf Ubuntu 20.04.

Newbie

Posts

Joined
Sat Mar 17, 2018 3:15 am

Post by OSWorX » Fri Nov 20, 2020 5:56 am

Auf die Schnelle würde ich sagen dass das hier nicht passt:

Code: Select all

RewriteBase /oc/shop/
denn es kommt darauf an was in Plesk (nicht nur dort) als Hauptorder definiert wurde.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by Crafti1995 » Fri Nov 20, 2020 6:04 am

Hallo,

danke.

In Plesk zeigt die Domain auf /httpdocs/oc/shop.
Warum sollte dann RewriteBase /oc/shop/ nicht passen, bzw. wo sollte noch etwas definiert sein als Hauptordner?

Mfg

Newbie

Posts

Joined
Sat Mar 17, 2018 3:15 am

Post by OSWorX » Fri Nov 20, 2020 2:49 pm

Crafti1995 wrote:
Fri Nov 20, 2020 6:04 am
In Plesk zeigt die Domain auf /httpdocs/oc/shop.
Warum sollte dann RewriteBase /oc/shop/ nicht passen, bzw. wo sollte noch etwas definiert sein als Hauptordner?
Dann nur

Code: Select all

RewriteBase /
da ja schon darauf mit Plesk verwiesen wird.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by Crafti1995 » Sun Nov 22, 2020 2:17 am

Guten Abend,

nun liegt das Forum unter domain.endung/shop und die .htaccess liegt in /shop.
In der .htaccess heißt es RewriteBase /, in Plesk ist die domain auf httdocs/shop geleitet.

Die SEO URLs funktionieren leider immer noch nicht.

Edit: Der Webserver ist apache und mod_rewrite ist an.

Newbie

Posts

Joined
Sat Mar 17, 2018 3:15 am

Post by OSWorX » Sun Nov 22, 2020 5:00 am

Warum jetzt auf einmal "Forum"?
Dachte ein Shop soll dort laufen ..

Ich selber betreibe etliche Server mit unzähligen Kunden darauf.
Alle mit Plesk - ohne Probleme, egal in welchem Verzeichnis die Webs jeweils liegen.

Wichtig nur ist, dass wenn man in Plesk den Basispfad anders als httpdocs/ definiert (also z.B. httpdocs/shop1/) in der .htaccess der Wert lauten muss:

Code: Select all

RewriteBase /
da ja hier schon der richtige Ordner aufgerufen wird.

Anders wäre es wenn in Plesk der Pfad auf httpdocs/ lauten würde und der Shop unter httpdocs/shop1/ läge.
Dann ist klar das es lauten muss:

Code: Select all

RewriteBase /shop1/
da ja hier als erstes der Rootordner aufgerufen wird und nicht shop1.

Gilt auch für alle Subdomains.

Da ich die weiteren Servereinstellungen und installierten Module nicht kenne, noch ein Tipp: eventuell
Options +FollowSymlinks
auskommentieren.

Tipp 2: mal die Serverlogs ansehen und nachlesen was darin aufgezeichnet ist zu den Fehlern!

So, und damit jetzt genug, hier geht es OpenCart und nicht um falsche Servereinstellungen oder Nachhilfe dazu.
Glaube es wird am besten sein wenn ein Profi engagiert wird.

p.s.: dass der Webserver in Linuxrechner sein sollte, versteht sich von selber .. klar läuft Plesk auch unter Windofs, aber eine Webseite mit IIS zu betreiben kann ich aus meiner Sicht nicht unterstützen.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by Crafti1995 » Sun Nov 22, 2020 6:17 am

Guten Abend,

ich meinte natürlich nicht Forum sondern Shop.
Ja, es ist Linux.

Fehler gefunden, es lag an dem Options +FollowSymlinks die nicht auskommentiert war.

Danke für die Hilfe.

Newbie

Posts

Joined
Sat Mar 17, 2018 3:15 am
Who is online

Users browsing this forum: No registered users and 7 guests