

RewriteEngine On
Options +SymLinksIfOwnerMatch
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]


### Error-Docs
ErrorDocument 404 /error_404/
### go to backend
RewriteRule ^easywayshop(/)?$ index.php?admin_modul=admin_dashboard [R=301]

### Logout
RewriteRule ^LogOff/$ index.php?logout=1 [L,NC,QSA]

### Lightingrod
RewriteRule ^LightingRod/$ index.php?lightningrod=1 [L,NC,QSA]

### items.csv
RewriteRule ^Kundencenter/(items).(csv)$ index.php?structure_suri=Kundencenter&action=get_item_export [L,NC,QSA]

### get google shopping csv
#RewriteRule ^google_de.csv?$ index.php?website_modul=website_export&id=google_de [L,NC,QSA]

### Language selection
RewriteRule ^lang/([a-zA-Z0-9-_,]+)/$ index.php?lang=$1 [L,NC,QSA]


### Manufacturer views
	## Manufacturer only
	RewriteRule ^Kaufen/([a-zA-Z0-9-_,]+)/$ index.php?seo_manufacturer_suri=$1 [L,NC,QSA]

	## Manufacturer and structure group
	RewriteRule ^Kaufen/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/$ index.php?seo_manufacturer_suri=$1&structureSuri=$2 [L,NC,QSA]

### Item category navigation and pages
	RewriteRule ^([a-zA-Z0-9-_,]+)(/Seite-([0-9]+))?/$ index.php?structure_suri=$1&page=$3 [L,NC,QSA]
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)(/Seite-([0-9]+))?/$ index.php?structure_suri=$2&structure_suri2=$1&page=$4 [L,NC,QSA]
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)(/Seite-([0-9]+))?/$ index.php?structure_suri=$3&structure_suri1=$2&structure_suri2=$1&page=$5 [L,NC,QSA]
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)(/Seite-([0-9]+))?/$ index.php?structure_suri=$4&structure_suri1=$3&structure_suri2=$2&structure_suri3=$1&page=$6 [L,NC,QSA]
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)(/Seite-([0-9]+))?/$ index.php?structure_suri=$5&structure_suri1=$4&structure_suri2=$3&structure_suri3=$2&structure_suri4=$1&page=$7 [L,NC,QSA]
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)(/Seite-([0-9]+))?/$ index.php?structure_suri=$6&structure_suri1=$5&structure_suri2=$4&structure_suri3=$3&structure_suri4=$2&structure_suri5=$1&page=$8 [L,NC,QSA]
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)(/Seite-([0-9]+))?/$ index.php?structure_suri=$7&structure_suri1=$6&structure_suri2=$5&structure_suri3=$4&structure_suri4=$3&structure_suri5=$2&structure_suri6=$1&page=$9 [L,NC,QSA]
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)(/Seite-([0-9]+))?/$ index.php?structure_suri=$8&structure_suri1=$7&structure_suri2=$6&structure_suri3=$5&structure_suri4=$4&structure_suri5=$3&structure_suri6=$2&structure_suri7=$1&page=$10 [L,NC,QSA]

### Item views
	## 7. Level / 5. Manufacturer
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([aA-zZ0-9-_,]+)/([aA-zZ0-9-_,]+)/([aA-zZ0-9-_,]+)/([aA-zZ0-9-_,]+)/([aA-zZ0-9-_,]+).(html)$ index.php?structure_suri3=$1&structure_suri2=$2&structure_suri=$3&structure_suri=$4&structure_suri=$5&structure_suri=$6&structure_suri=$7&item_suri=$8 [L,NC,QSA]
	
	## 6. Level / 4. Manufacturer
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([aA-zZ0-9-_,]+)/([aA-zZ0-9-_,]+)/([aA-zZ0-9-_,]+)/([aA-zZ0-9-_,]+).(html)$ index.php?structure_suri3=$1&structure_suri2=$2&structure_suri=$3&structure_suri=$4&structure_suri=$5&structure_suri=$6&item_suri=$7 [L,NC,QSA]
	
	## 5. Level / 3. Manufacturer
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([aA-zZ0-9-_,]+)/([aA-zZ0-9-_,]+)/([aA-zZ0-9-_,]+).(html)$ index.php?structure_suri3=$1&structure_suri2=$2&structure_suri=$3&structure_suri=$4&structure_suri=$5&item_suri=$6 [L,NC,QSA]
	
	## 4. Level / 2. Manufacturer
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([aA-zZ0-9-_,]+)/([aA-zZ0-9-_,]+).(html)$ index.php?structure_suri3=$1&structure_suri2=$2&structure_suri=$3&structure_suri=$4&item_suri=$5 [L,NC,QSA]
	
	## 3. Level / 1. Manufacturer
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([aA-zZ0-9-_,]+).(html)$ index.php?structure_suri3=$1&structure_suri2=$2&structure_suri=$3&item_suri=$4 [L,NC,QSA]
	
	## 2. Level
	RewriteRule ^([a-zA-Z0-9-_,]+)/([a-zA-Z0-9-_,]+)/([aA-zZ0-9-_,]+).(html)$ index.php?structure_suri2=$1&structure_suri=$2&item_suri=$3 [L,NC,QSA]

	## 1. Level
	RewriteRule ^([a-zA-Z0-9-_,]+)/([aA-zZ0-9-_,]+).(html)$ index.php?structure_suri=$1&item_suri=$2 [L,NC,QSA]

	## Direct
	RewriteRule ^([aA-zZ0-9-_,]+).(html)$ index.php?item_suri=$1 [L,NC,QSA]

### google xml sitemap
	RewriteRule ^(sitemap).(xml)$ index.php?website_modul=website_sitemap&action=get_xml [L,NC,QSA]

### export files to search engines
	RewriteRule ^export/([a-zA-Z0-9-_,]+).(csv)$ index.php?website_modul=website_export&id=$1 [L,NC,QSA]


