From 4c3d7388814adb5f93192afc569347b464bd7ea9 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Wed, 10 Jun 2020 19:58:00 +0200 Subject: [PATCH] Rewrite rule --- .htaccess | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..38c51a8 --- /dev/null +++ b/.htaccess @@ -0,0 +1,9 @@ +Options -MultiViews +RewriteEngine On + +# redirect "/image.php?slika=xxx&okvir=yy" to "/image/yy/xxxx" +RewriteCond %{THE_REQUEST} \s/image\.php\?slika=([A-Za-z0-9]+)&okvir=([0-9]+)\s [NC] +RewriteRule ^ /images/%2/%1? [R=301,L] + +# internally rewrite "/section/xxx" to "/section.php?id=xxx" +RewriteRule ^images/([0-9]+)/([A-Za-z0-9]+)$ /image.php?slika=%2&okvir=%1 [L]