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

Redirect Question
(1 Online) (1) Ospite
  • Pagina:
  • 1

ARGOMENTO: Redirect Question

Redirect Question 15 Anni, 2 Mesi fa #694

  • dup
  • Offline
  • Fresh Boarder
  • Messaggi: 5
Thanks for great component!

My "From URL" /videoEn
"To URL" /index.php?option=com_content&view=article&id=61&Itemid=41&lang=en

that redirects /videoEn to /index.php?option=com_content&view=article&id=61&Itemid=41&lang=en page.

Question:
how can i do it other way around: when i access /index.php?option=com_content&view=article&id=61&Itemid=41&lang=en to be redirected to /videoEn ???

tried to swap values in "From URL" and "To URL" fields but that didn;t help.
Looking forward to your reply!
L'Argomento è stato bloccato.

Re:Redirect Question 15 Anni, 2 Mesi fa #704

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

Question:
how can i do it other way around: when i access /index.php?option=com_content&view=article&id=61&Itemid=41&lang=en to be redirected to /videoEn ???


From URL /index.php\?option=com_content&view=article&id=61&Itemid=41&lang=en
To URL: http://{siteurl}/videoEn
 


Note the escape on question mark "\?".

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

Re:Redirect Question 15 Anni, 2 Mesi fa #706

  • dup
  • Offline
  • Fresh Boarder
  • Messaggi: 5
thanks for your reply!
however that doesn't work. when i click this /index.php\?option=com_content&view=article&id=61&Itemid=41&lang=en
i'm being redirected to home (i guess thru .htaccess), but in address bar i have /videoEn

may be i need to correct the rule in .htaccess?
Currently i have there:
ErrorDocument 404 /index.php
L'Argomento è stato bloccato.

Re:Redirect Question 15 Anni, 2 Mesi fa #708

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Oops,
there was a misunderstanding. You want to create a short URL alias, so:

From URL. /videoEn$
To URL: http://{siteurl}/index.php\?option=com_content&view=article&id=61&Itemid=41&lang=en


In this way, when you call www.yoursite.com/videoEn you will be redirected to the real destination content page (To URL).

But for this to work, you must change your ErrorDocument as follow:

ErrorDocument 404 /


It means, drop index.php.

Let me know,
Luigi
Ultima modifica: 15 Anni, 2 Mesi fa Da admin.
L'Argomento è stato bloccato.

Re:Redirect Question 15 Anni, 2 Mesi fa #709

  • dup
  • Offline
  • Fresh Boarder
  • Messaggi: 5
what i want to achieve:
when i call /index.php?option=com_content&view=article&id=61&Itemid=41&lang=en to be redirected to mysite.com/videoEn and mysite.com/videoEn should be displayed in address bar

plus

if i call mysite.com/videoEn i'm staying at mysite.com/videoEn without redirection.

is that possible?

I tried ErrorDocument 404 /
and your plugin didn't work for me that way. When i changed it to
ErrorDocument 404 /index.php
it started to work.
L'Argomento è stato bloccato.

Re:Redirect Question 15 Anni, 2 Mesi fa #710

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Just a question.

But mysite.com/videoEn exists or not?

when i call /index.php?option=com_content&view=article&id=61&Itemid=41&lang=en to be redirected to mysite.com/videoEn and mysite.com/videoEn should be displayed in address bar


This can be done with ReDJ, because it's a redirection. But the destination URL MUST exists.

If the destination URL doesn't exists, the only way to display something without change URL address in browser address bar is to rewrite URL on server side. And this can be done (e.g. using Apache mod_rewrite), but not with ReDJ. ReDJ does redirections.

I hope it was clear.

Regards,
Luigi
L'Argomento è stato bloccato.

Re:Redirect Question 15 Anni, 2 Mesi fa #711

  • dup
  • Offline
  • Fresh Boarder
  • Messaggi: 5
admin wrote:


If the destination URL doesn't exists, the only way to display something without change URL address in browser address bar is to rewrite URL on server side. And this can be done (e.g. using Apache mod_rewrite), but not with ReDJ. ReDJ does redirections.


mysite.com/videoEn don't exists. Can you give me a tip how to to rewrite URL on server side using Apache mod_rewrite that mysite.com/videoEn would stay in address bar?? Should I put some lines to .htaccess?

Thanks a lot for your help!!
L'Argomento è stato bloccato.

Re:Redirect Question 15 Anni, 2 Mesi fa #712

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Of course:

httpd.apache.org/docs/2.0/rewrite/rewrite_guide.html

Content Handling
From Old to New (intern)

Description:

Assume we have recently renamed the page foo.html to bar.html and now want to provide the old URL for backward compatibility. Actually we want that users of the old URL even not recognize that the pages was renamed.
Solution:

We rewrite the old URL to the new one internally via the following rule:

RewriteEngine on
RewriteBase /~quux/
RewriteRule ^foo\.html$ bar.html


In your case add this directive just after RewriteBase:

########## End - Rewrite rules to block out some common exploits

# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)

# RewriteBase /
RewriteRule ^videoEn$ http://www.yoursite.com/index.php?option=com_content&view=article&id=61&Itemid=41&lang=en [P,L]


You just need to change www.yoursite.com in the example above with your real domain. Note that we are using mod_rewrite to do INTERNAL REDIRECTION, so that from client side the URL remains the original one.

But for this to work as you want, we need to add a proxy flag at the end and also be sure to enable mod_proxy and mod_http_proxy, otherwise this will not work.

The reason is the following. You could use something like this:

RewriteRule ^videoEn$ /index.php?option=com_content&view=article&id=61&Itemid=41&lang=en


I'm assuming your site is on the root folder of domain. In this case the internal redirect happens, but to the destination page (Joomla) the REQUEST_URI appears as the original one (/videoEn) and this cause a "component error".

I hope I was clear enough. Unfortunately redirection and rewrite are two hard Apache topics.

Let me know,
Luigi
Ultima modifica: 15 Anni, 2 Mesi fa Da admin.
L'Argomento è stato bloccato.

Re:Redirect Question 15 Anni, 2 Mesi fa #713

  • dup
  • Offline
  • Fresh Boarder
  • Messaggi: 5
thanks a lot!
althrough it seems complicated for total newbie like me i will try that.

one more question:
is there's the way to redirect from this URL

From URL: /#shop
To URL: /index.php?page=shop.product_details&flypage=flypage_images.tpl&product_id=88&category_id=4&option=com_virtuemart&Itemid=1

It's anchor URL (with #), and when i try to redirect from it, nothing happens.
L'Argomento è stato bloccato.

Re:Redirect Question 15 Anni, 2 Mesi fa #714

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
No, this is a mission impossible.

An URL with the sharp (#) doesn't go anywhere. The browser stay in the page and no calls are made to the server. So, it's impossible to redirect just because you stay firm...

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