#! (Hashbang) aus URL

Hallo unter https://help.spreadshirt.com/hc/de/articles/207487815-Webseiten-Integration-per-JavaScript steht, das mit usePushState = true weg bekommt, aber etwas in der .htaccess tun muss.
Toll wäre es gewesen wenn man dazu schreibt was in der .htaccess zu tun damit dies geht!
Kann bitte jemand erklären was da zu tun ist?

Lieben Gruß
Bernd

Ich habe eben Antwort von unserem Chef-Spreadshop-Entwickler erhalten (auf Englisch - hoffe man versteht das trotzdem)

An simple (apache2) .htaccess file could look as follows (if you’ve embedded your shop in index.html in the root of your webserver):

#check if mod_rewrite is available
< IfModule mod_rewrite.c>
# activate rewrites for this directory
RewriteEngine On
# needs to be changed when shop is embedded in subdirectory, e.g. /shop/
RewriteBase /
# do not rewrite (existing) files in directory
RewriteCond %{REQUEST_FILENAME} !-f
# do not rewrite (existing) subdirectories
RewriteCond %{REQUEST_FILENAME} !-d
# redirect everything that is left to index.html (change if your html document has a different name)
RewriteRule . index.html [L]

Please be aware that this configuration depends on your webserver and it is up to you to make it work. We won’t support you with this.

Noch Fragen :slight_smile: ?

3 Likes

@Lena_Spreadshop

danke den .htaccess Code verstehe ich und auch was er geschrieben hat.

Lieben Gruß
Bernd

Super :smiley: