Improve URLs

This commit is contained in:
grandeljay 2022-06-08 14:42:17 +02:00
parent c4fc9517d2
commit 01c5e08fad
2 changed files with 7 additions and 4 deletions

View file

@ -8,13 +8,16 @@
RewriteRule ^([a-z\-]+)$ /?page=$1 [QSA,L] RewriteRule ^([a-z\-]+)$ /?page=$1 [QSA,L]
# Wishlists (My lists) # Wishlists (My lists)
RewriteRule ^(wishlists)/([0-9]+)$ /?page=$1&id=$2 [QSA,L] RewriteRule ^wishlists/([0-9]+)$ /?page=wishlists&id=$1 [QSA,L]
# Wish # Wish
RewriteRule ^(wish)/(\d+)$ /?page=$1&id=$2 [QSA,L] RewriteRule ^wish/(\d+)$ /?page=wish&id=$1 [QSA,L]
# Wishlist # Wishlist
RewriteRule ^(wishlist)/([0-9a-f]{40})$ /?page=$1&hash=$2 [QSA,L] RewriteRule ^wishlist/([0-9a-f]{40})$ /?page=wishlist&hash=$1 [QSA,L]
# Blog Post
RewriteRule ^blog/([a-z\-0-9]+)$ /?page=blog&slug=$1 [QSA,L]
</IfModule> </IfModule>
##-- When caching of gzipped JS and CSS files is used, enable this setting ##-- When caching of gzipped JS and CSS files is used, enable this setting

View file

@ -84,7 +84,7 @@ class URL
explode('&', parse_url($target, PHP_URL_QUERY)) explode('&', parse_url($target, PHP_URL_QUERY))
); );
$flags = explode(',', substr($parts[3], 1, -1)) ?? array(); $flags = explode(',', substr($parts[3], 1, -1)) ?? array();
$parameters = query_to_key_value_pair($this->url); $parameters = array_reverse(query_to_key_value_pair($this->url), true);
preg_match_all('/\(.+?\)/', $rewriteRule, $regexes); preg_match_all('/\(.+?\)/', $rewriteRule, $regexes);