// fix htaccess generation
This commit is contained in:
@@ -492,9 +492,9 @@ class DispatcherCore
|
|||||||
$replace = $route['keywords'][$key]['prepend'].$params[$key].$route['keywords'][$key]['append'];
|
$replace = $route['keywords'][$key]['prepend'].$params[$key].$route['keywords'][$key]['append'];
|
||||||
else
|
else
|
||||||
$replace = '';
|
$replace = '';
|
||||||
$url = preg_replace('#(*UTF8)\{([^{}]+:)?'.$key.'(:[^{}])?\}#', $replace, $url);
|
$url = preg_replace('#\{([^{}]+:)?'.$key.'(:[^{}])?\}#', $replace, $url);
|
||||||
}
|
}
|
||||||
$url = preg_replace('#(*UTF8)\{([^{}]+:)?[a-z0-9_]+?(:[^{}])?\}#', '', $url);
|
$url = preg_replace('#\{([^{}]+:)?[a-z0-9_]+?(:[^{}])?\}#', '', $url);
|
||||||
}
|
}
|
||||||
// Build a classic url index.php?controller=foo&...
|
// Build a classic url index.php?controller=foo&...
|
||||||
else
|
else
|
||||||
|
|||||||
+5
-5
@@ -1563,8 +1563,8 @@ class ToolsCore
|
|||||||
fwrite($write_fd, "# Images\n");
|
fwrite($write_fd, "# Images\n");
|
||||||
if (Configuration::get('PS_LEGACY_IMAGES'))
|
if (Configuration::get('PS_LEGACY_IMAGES'))
|
||||||
{
|
{
|
||||||
fwrite($write_fd, 'RewriteRule (*UTF8)^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.'$1-$2$3.jpg [L]'."\n");
|
fwrite($write_fd, 'RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.'$1-$2$3.jpg [L]'."\n");
|
||||||
fwrite($write_fd, 'RewriteRule (*UTF8)^([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.'$1-$2.jpg [L]'."\n");
|
fwrite($write_fd, 'RewriteRule ^([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.'$1-$2.jpg [L]'."\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rewrite product images < 100 millions
|
// Rewrite product images < 100 millions
|
||||||
@@ -1577,10 +1577,10 @@ class ToolsCore
|
|||||||
$img_name .= '$'.$j;
|
$img_name .= '$'.$j;
|
||||||
}
|
}
|
||||||
$img_name .= '$'.$j;
|
$img_name .= '$'.$j;
|
||||||
fwrite($write_fd, 'RewriteRule (*UTF8)^'.str_repeat('([0-9])', $i).'(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.$img_path.$img_name.".jpg [L]\n");
|
fwrite($write_fd, 'RewriteRule ^'.str_repeat('([0-9])', $i).'(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.$img_path.$img_name.".jpg [L]\n");
|
||||||
}
|
}
|
||||||
fwrite($write_fd, 'RewriteRule (*UTF8)^c/([0-9]+)(\-[_a-zA-Z0-9-\pL]*)/[_a-zA-Z0-9-]*\.jpg$ img/c/$1$2.jpg [L]'."\n");
|
fwrite($write_fd, 'RewriteRule ^c/([0-9]+)(\-[_a-zA-Z0-9-\pL]*)/[_a-zA-Z0-9-]*\.jpg$ img/c/$1$2.jpg [L]'."\n");
|
||||||
fwrite($write_fd, 'RewriteRule (*UTF8)^c/([a-zA-Z-]+)/[a-zA-Z0-9-\pL]+\.jpg$ img/c/$1.jpg [L]'."\n");
|
fwrite($write_fd, 'RewriteRule ^c/([a-zA-Z-]+)/[a-zA-Z0-9-\pL]+\.jpg$ img/c/$1.jpg [L]'."\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirections to dispatcher
|
// Redirections to dispatcher
|
||||||
|
|||||||
Reference in New Issue
Block a user