Home Forum
2024-03-19
Benvenuto, Ospite
Nome Utente Password: Ricordami

Article redirect
(1 Online) (1) Ospite
  • Pagina:
  • 1

ARGOMENTO: Article redirect

Article redirect 11 Anni, 11 Mesi fa #3203

  • roshan
  • Offline
  • Fresh Boarder
  • Messaggi: 2
I have a couple of articles that I want to redirect to another one when accessed.

xyz.com/projects/{variable}/17-site-pages/76-thane-projects
to
xyz.com/projects/


For example:
xyz.com/projects/mumbai/17-site-pages/76-thane-projects
to
xyz.com/projects/


xyz.com/projects/pune/17-site-pages/76-thane-projects
to
xyz.com/projects/

please help me with regex.

Thanks.
Ultima modifica: 11 Anni, 11 Mesi fa Da roshan.
L'Argomento è stato bloccato.

Re: Article redirect 11 Anni, 11 Mesi fa #3204

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi.

For example:
xyz.com/projects/mumbai/17-site-pages/76-thane-projects
to
xyz.com/projects/


From URL: ^/projects/mumbai/17-site-pages/76-thane-projects$
To URL: http://{siteurl}/projects


xyz.com/projects/pune/17-site-pages/76-thane-projects
to
xyz.com/projects/


From URL: ^/projects/pune/17-site-pages/76-thane-projects$
To URL: http://{siteurl}/projects
Ultima modifica: 11 Anni, 11 Mesi fa Da admin.
L'Argomento è stato bloccato.

Re: Article redirect 11 Anni, 11 Mesi fa #3205

  • roshan
  • Offline
  • Fresh Boarder
  • Messaggi: 2
Thanks for your reply.

Is there a wildcard approach, where we can have a single rule for the two. I will tell you the reason why. I have almost 70 city names with me apart from Mumbai and Pune. It will be almost impossible for me to create 70 redirect rules like you suggested below.

Regards.
L'Argomento è stato bloccato.

Re: Article redirect 11 Anni, 11 Mesi fa #3207

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Oh yes.

If you use just /mumbai/ in the from url, this rule matches any URL which contains this word. Also consider you can use a regular expression in the from URL and also some macros in the destination.

As example, now you are redirecting any old URL to the same destionation. But you can build something like:

From URL: /projects/mumbai/
To URL: http://{siteurl}/projects/newsection/{pathltrim /projects/mumbai/}{queryfull}


With this rule the URL:

xyz.com/projects/mumbai/17-site-pages/76-thane-projects

Will be redirected to:

xyz.com/projects/newsection/17-site-pages/76-thane-projects

And so on for any matching URL. That's the ReDJ power...

Kind regards,
Luigi
L'Argomento è stato bloccato.
  • Pagina:
  • 1
Moderatori: admin
Tempo generazione pagina: 0.61 secondi
Cerca con Google
News
Chi è online
 38 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.