Welcome! Log In Create A New Profile

Advanced

Rewrite rules for Oxid eShop

Posted by maverick78 
Rewrite rules for Oxid eShop
March 13, 2012 06:43PM
Hello!

Does anyone know working rewrite rule for Oxid eShop?

I have the following vhost configuration

-----------------------------------------------------------------------------

server {
listen 80;

root /www/example.com;

index index.php index.html;

server_name www.example.com;

# OXID eShop Rewrite Regeln
set $script_name $fastcgi_script_name;
set $fcgi_php 127.0.0.1:9000;
fastcgi_read_timeout 1800;

# Im Admin und Setup wird kein Rewrite auf die oxseo.php benötigt.
location ~ ^/(setup|admin|Gutschein|Mails|views|core)/?$ {
set $script_name /$1/index.php;
include fastcgi_params.oxid;
}

# Zugriff auf die internen Dateien und Apache's ".ht" Dateien verweigern.
location ~ (/\.ht|EXCEPTION_LOG\.txt|\.log$|\.tpl$|pkg.rev) {
deny all;
}

# OXID 4.5.2+ spezifisch
location ~ /out/pictures/.*(\.jpg|\.gif|\.png)$ {
try_files $uri /core/utils/getimg.php;
}

# Für das "out" Verzeichnis sind keine Rewrite-Regeln anzuwenden.
location ~ /(export|modules|out|tmp|views|Gutschein/*|Mails/*|Banner)/ {
}

# OXID eShop Setup: Prüfung auf "mod_rewrite".
location = /oxseo.php {
if ($args ~ "mod_rewrite_module_is=off") {
rewrite /oxseo.php /oxseo.php?mod_rewrite_module_is=on? break;
}

set $script_name oxseo.php;
include fastcgi_params.oxid;
}

# PHP-Dateien über PHP-FastCGI ausführen.
# location ~ \.php$ {
location ~ ^(.*)\.php$ {
# Zero-day exploit defense.
# http://forum.nginx.org/read.php?2,88845,page=3
try_files $uri =404;
include fastcgi_params.oxid;
}

# SEO URLs auf die oxseo.php leiten.
location / {
if (!-e $request_filename) {
set $script_name /oxseo.php;
}

include fastcgi_params.oxid;
}

# Anfragen auf das Root Dokument auf die index.php leiten.
location = / {
fastcgi_index index.php;
set $script_name $fastcgi_script_name;
include fastcgi_params.oxid;
}

}

-------------------------------------------------------------------------

Most things run as expected, but static files like offline.html or robots.txt give 403 forbidden. When I comment out the the following part, the textfiles are normally delivered with response code 200 found.

# SEO URLs auf die oxseo.php leiten.
location / {
if (!-e $request_filename) {
set $script_name /oxseo.php;
}

include fastcgi_params.oxid;
}

So, any hint what the problem might be? I got stucked for a few days with this problem now.



Edited 2 time(s). Last edit at 03/13/2012 06:44PM by maverick78.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 202
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready