Home Forum
2025-01-02
Benvenuto, Ospite
Nome Utente Password: Ricordami

Complex URL rewrite
(1 Online) (1) Ospite
  • Pagina:
  • 1

ARGOMENTO: Complex URL rewrite

Complex URL rewrite 13 Anni, 4 Mesi fa #2453

  • apercey
  • Offline
  • Fresh Boarder
  • Messaggi: 4
Hi, I'm trying to improve a URL for visitors and search engines. I bought the enterprise version so I could do this with a 200 redirect. My understanding from your doc is that a 200 redirect is required because the target URL doesn't really exist.

But my replacement is a bit complex:

From URL: mysite.com/dir1/item/123-name1
To URL: mysite.com/dir1/name1

So I want to eliminate "/item/123-"

What makes this complicated is that "dir1" and "name1" can have many different values. Also "123" can be any number of one to three digits.

Is such a replacement possible with ReDJ?

Many Thanks,

Andrew
L'Argomento è stato bloccato.

Complex URL rewrite 13 Anni, 4 Mesi fa #2454

  • apercey
  • Offline
  • Fresh Boarder
  • Messaggi: 4
*** Sorry if this is a duplicate post. I didn't see the first one go through. ***

Hi, I'm trying to improve a URL for visitors and search engines. I bought the enterprise version so I could do this with a 200 redirect. My understanding from your doc is that a 200 redirect is required because the target URL doesn't really exist.

But my replacement is a bit complex:

From URL: mysite.com/dir1/item/123-name1
To URL: mysite.com/dir1/name1

So I want to eliminate "/item/123-"

What makes this complicated is that "dir1" and "name1" can have many different values. Also "123" can be any number of one to three digits.

Is such a replacement possible with ReDJ?

Many Thanks,

Andrew
L'Argomento è stato bloccato.

Re: Complex URL rewrite 13 Anni, 4 Mesi fa #2474

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi Andrew,
sorry for delay (I was on vacation)...

So,
it seems you would like to create an alias using the internal redirect.

The alias (shortest URL) should be /dir1/name1 and this should show the content of mysite.com/dir1/item/123-name1. If this is you need create this item:

From URL: ^/dir1/name1$
To URL: http://{siteurl}/dir1/item/123-name1


And remember to set redirect type to 200 (you can with Enterprise version).

Let me know,
Luigi
L'Argomento è stato bloccato.

Re: Complex URL rewrite 13 Anni, 4 Mesi fa #2506

  • apercey
  • Offline
  • Fresh Boarder
  • Messaggi: 4
Hi Luigi,

Thank you for your reply. I hope you had a good vacation!

Your solution may work if "dir1" and "name1" are unchanging. However, as I mentioned, those are variable in my case. Nearly a hundred different values are possible.

The only part of the URL that is consistent is the "/item/" piece and fact that it will always be followed by a number of 1-3 digits (the number itself will vary with each URL) which is always followed by a caret. So is there a way to match on "/item/123-" (where "123" can be any number of 1-3 digits) in order to recognize it and remove it from the URL?

But aside from that, maybe what I'm asking for can't be done? Your response shows how to translate a shortened URL into a full URL that the Joomla component will recognize. But what I want to do is change the actual Joomla component URL so that whether you reach the page from an external link or through a component action, the URL will always display as the shortened version. Is ReDJ (or any SEF component) capable of doing this, or will I need to have the component itself modified?

Thanks,

Andrew
Ultima modifica: 13 Anni fa Da admin.
L'Argomento è stato bloccato.

Re: Complex URL rewrite 13 Anni, 4 Mesi fa #2512

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi Andrew,
first let me say that what you need (mantain the short URL in the browser) could be done by the Enterprise version of ReDJ (feature internal redirect), but I would suggest you to fist try to get the redirect you need with Community version (with a standard 301 redirect).

About the matching rule, this could be:

From URL: /item/[0-9]{1,3}-


But I'm afraid that what you really need is a little bit different. If you would like that the user write the shortest URL and get the page for the longest one:

User call http://www.yoursite.com/dir1/name1 and get the content of http://www.yoursite.com/dir1/item/123-name1


If so, let me say you can't do this with ReDJ. The reason is that there's no way (e.g. with macros) for ReDJ to know the missing information needed to build the real destination, /item/123-, because the digits are different for any call.

Let me know,
Luigi
Ultima modifica: 13 Anni, 4 Mesi fa Da admin.
L'Argomento è stato bloccato.
  • Pagina:
  • 1
Moderatori: admin
Tempo generazione pagina: 0.67 secondi
Cerca con Google
News
Chi è online
 143 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.