Home Forum
2017-11-19
Menu principale
Prodotti
Giochi a premi
Accedi ai servizi
Newsletter
Ricezione
Benvenuto, Ospite
Nome Utente Password: Ricordami

Help for many URL expressions (dynamic item)
(1 Online) (1) Ospite
  • Pagina:
  • 1
  • 2

ARGOMENTO: Help for many URL expressions (dynamic item)

Help for many URL expressions (dynamic item) 6 Anni fa #2723

  • vedouze
  • Offline
  • Fresh Boarder
  • Messaggi: 6
Hello Luigi,
First of all, thanks a million for your component as it seems to be the solution for many of us!

I read the instructions, proceed to the installation and made a 404 page so until now everything works.

I'm not good at macro so I'm asking for your help because I've many expression to change at the same time and don't really understand (despite your super doc!) how to manage them.

1- I need to redirect from these type of URL:
www.mysite.com/productos/accesorios/menu/page:2/
www.mysite.com/productos/solares/menu/page:7/limit:10/
www.belleza-chic.com/productos/accesorios/menu/page:4/limit:35/

to their new URL:
www.mysite.com/productos/accesorios.html?page=2
www.mysite.com/productos/solares.html?page=7
www.belleza-chic.com/productos/accesorios.html?page=4

So I want to change from
/{anything here}/menu/page:{page#}/{anything or nothing here}
To:
/{anything here}?page={page#}

How do I achieve it?

2- in some cases, I have a missing part of URL, so I need to change from:
www.mysite.com/accesorios/rest-of-my-URL.html
to:
www.mysite.com/productos/accesorios/rest-of-my-URL.html

The missing part (always the same chain: productos) to add between the {host} and the /category/ (in this case: accesorios).

So if you show me the item I need to set up in ReDJ for this case, I will replicate it for the other categories.

I forget to say that sometimes, I need the 1+2 for one URL, just like:
www.mysite.com/solares/menu/page:7/limit:10
needs to become:
www.mysite.com/productos/solares.html?page=7


I hope I will understand it more so I won't ask you again!!!
Many thanks anyway
Fred

Re: Help for many URL expressions (dynamic item) 6 Anni fa #2727

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi Fred,
the first question is clear and this could be done by an item as follow:

From URL: /menu/page:
To URL: http://{siteurl}/{preg_match 1}/\/(.*)\/menu\/page:/i{/preg_match}.html?page={preg_match 1}/\/menu\/page:([0-9]+)\//i{/preg_match}


I've not tested but it should work.

The second question is a little bit tricky, just because you would like to add a pattern (productos) to URL that contains /menu/page, BUT ONLY SOMETIMES. This is tricky because the first rule always match these pattern (/menu/pages), so we should create new rules specific for these cases and put them BEFORE the previous one.

As example, you need a rule to change www.mysite.com/solares/menu/page:7/limit:10 into www.mysite.com/productos/solares.html?page=7. My question is how to understand that this is a special case if it contains /menu/page:7 pattern???

Re: Help for many URL expressions (dynamic item) 6 Anni fa #2749

  • vedouze
  • Offline
  • Fresh Boarder
  • Messaggi: 6
Dear Luigi,
Thank you for your help. I have been trying to solve my redirections but I think I still require your lights.

First of all, I did set up the rule you gave me (I bought and installed your pro version for using the macro) but it's not working. But maybe we can leave that for later as I finally understood (after re-reading your helpfull doc) that the replacing rules are not cumulated but executed in the order they appear.

Ideally I want to start with a rule for most of my problematic URL, let me directly show you the indexed vs the new URL:


Indexed:
www.belleza-chic.com/maquillaje/sombras-de-ojos/5:couleurs-designer-_todo-en-una-sola-paleta-de-dior-000000004648/order:editor_rating/page:2/limit:20/
New:
www.belleza-chic.com/5-couleurs-designer-de-dior-en-belleza-chic.html

Indexed:
www.belleza-chic.com/perfumes/perfumes-para-ella/michael:kors-de-michael-kors-2011021514948/page:7/limit:10/
New:
www.belleza-chic.com/michael-kors-de-michael-kors-en-belleza-chic.html

Indexed:
www.belleza-chic.com/cabellos/tinte-_-coloración/garnier:nutrisse-crema-de-garnier-000000003742/limit:45/order:editor_rating/
New:
www.belleza-chic.com/garnier-nutrisse-crema-de-garnier-en-belleza-chic.html

So basically I need to identify all URL containing a number of 12 or 13 digits and:
1- replacing ":" by "-"
2- replacing the number + all the rest of the URL by "en-belleza-chic.html"

Is it doable??
I hope so, I have thousands of them...

Many thanks
Fred

Re: Help for many URL expressions (dynamic item) 6 Anni fa #2750

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi Fred,
that's so tricky... I like!

Tested on my local site, it should works for you too. Here it is (without breathing):

From URL: ^/[^/]+/[^/]+/[^/]+-[0-9]{12,13}/
To URL: http://{siteurl}/{preg_match 3}/\/([^\/]+)\/([^\/]+)\/([^:]+):/i{/preg_match}-{preg_match 4}/\/([^\/]+)\/([^\/]+)\/([^:]+):(.*)-([0-9]{12,13})\//i{/preg_match}.html


Don't you think that this rule alone is worth every penny of the subscription?

Beste regards,
Luigi

Re: Help for many URL expressions (dynamic item) 6 Anni fa #2751

  • vedouze
  • Offline
  • Fresh Boarder
  • Messaggi: 6
Oooh man, you're a star
And deserving largely your subscription cost!

Just one detail:
www.belleza-chic.com/maquillaje/sombras-de-ojos/5:couleurs-designer-_todo-en-una-sola-paleta-de-dior-000000004648/order:editor_rating/page:2/limit:20/

Now brings to (much better than my default 404 anyway!!):
www.belleza-chic.com/sombras-de-ojos/5-couleurs-designer-_todo-en-una-sola-paleta-de-dior.html

which works but still not the desired result of:
www.belleza-chic.com/5-couleurs-designer-de-dior-en-belleza-chic.html

Ok, I added "en-belleza-chic" to the expression (ok...esay one )... but can't figure out how to delete the /sombras-de-ojos/ from it?

And don't worry I still have more tricks to come
Thanks a million

Re: Help for many URL expressions (dynamic item) 6 Anni fa #2752

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi Fred, this is really strange.

Please, post here the rule as you have configured. I will test for you.

Luigi

Re: Help for many URL expressions (dynamic item) 6 Anni fa #2753

  • vedouze
  • Offline
  • Fresh Boarder
  • Messaggi: 6
Ok Luigi. I have SEF Advance but disable for ReDJ.
This is the rule.

 
From URL:
^/[^/]+/[^/]+/[^/]+-[0-9]{12,13}/
 
Order:
0
 
To URL:
http://{siteurl}/{preg_match 3}/\/([^\/]+)\/([^\/]+)\/([^:]+):/i{/preg_match}-{preg_match 4}/\/([^\/]+)\/([^\/]+)\/([^:]+):(.*)-([0-9]{12,13})\//i{/preg_match}-en-belleza-chic.html
 
Redirect:
301
 
Case Sensitive:
No
Ultima modifica: 6 Anni fa Da vedouze.

Re: Help for many URL expressions (dynamic item) 6 Anni fa #2754

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Try this (more robust):

From URL: ^/[^/]+/[^/]+/[^/]+-[0-9]{12,13}/
To URL: http://{siteurl}/{preg_match 4}/:\/\/([^\/]+)\/([^\/]+)\/([^\/]+)\/([^:]+):/i{/preg_match}-{preg_match 5}/:\/\/([^\/]+)\/([^\/]+)\/([^\/]+)\/([^:]+):(.*)-([0-9]{12,13})\//i{/preg_match}-en-belleza-chic.html

Re: Help for many URL expressions (dynamic item) 6 Anni fa #2755

  • vedouze
  • Offline
  • Fresh Boarder
  • Messaggi: 6
Luigi, this one works perfectly!

Ok, now the tricky bit
In the same expression, how to make the character replacements in my product name?:
replace é by e
replace á by a
replace _ by -
replace ó by o
replace ñ by n

etc...

So for example my indexed URL:
http://www.belleza-chic.com/cabellos/acondicionadores-_-mascarillas/acondicionador:exprés-cuidado-clásico---_-stylius-de-deliplus-201012087716/order:editor_rating.html
would point to:
www.belleza-chic.com/acondicionador-expres-cuidado-clasico-----stylius-de-deliplus-en-belleza-chic.html

Ok you can kick me out if you feel like it
Thanks again
Fred
Ultima modifica: 6 Anni fa Da vedouze.

Re: Help for many URL expressions (dynamic item) 6 Anni fa #2756

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi Fred,
this is a little bit too tricky for the current ReDJ version. The reason is we need to modify the patterns found with the preg_match macro, and replace some chars inside.

The good news is that this will be possible in the next main release, because I'm adding support for multiple reusable variables for each rule. In this way I can add a preg_replace macro...

A temporary solution could be a rewrite rule in .htaccess file to transform this:

www.belleza-chic.com/cabellos/acondicionadores-_-mascarillas/acondicionador:exprés-cuidado-clásico---_-stylius-de-deliplus-201012087716/order:editor_rating.html

Into this:

www.belleza-chic.com/cabellos/acondicionadores-_-mascarillas/acondicionador:expres-cuidado-clasico---_-stylius-de-deliplus-201012087716/order:editor_rating.html

After this, ReDJ should to the rest of the work...
  • Pagina:
  • 1
  • 2
Moderatori: admin
Tempo generazione pagina: 0.50 secondi
News
Cerca con Google
Chi è online
 123 visitatori online
Sponsor

Slotmachineaamsonline.com è una guida alle migliori slot machine online legali in Italia. Sul sito trovi un elenco sempre aggiornato dei casino online con Slot machine e bonus slot, le ultime novità dal mondo delle slot online e le migliori strategie per vincere. Inoltre, è disponibile una sezione dedicata alle slot machine da BAR che finalmente sono disponibili nella versione online.