Home Forum
2024-12-22
Benvenuto, Ospite
Nome Utente Password: Ricordami

redirect from subdirectory to 1 higher level
(1 Online) (1) Ospite
  • Pagina:
  • 1

ARGOMENTO: redirect from subdirectory to 1 higher level

redirect from subdirectory to 1 higher level 14 Anni, 1 Mese fa #1549

  • flora
  • Offline
  • Fresh Boarder
  • Messaggi: 15
hello,

it says in the tutorial:
Here a practical example of dynamic destinations: Source URL
www.yoursite.com/old/index.php?task=view&id=123&ItemId=3 ReDJ “To URL”
http://{siteurl}/new.html{querybuild ItemId=12} Destination URL
www.yoursite.com/new.html?task=view&id=123&ItemId=12

how can it be done in redj?
because my site is on a subdirectory,
www.mysite.com/subdirectory/index.html
and i don't want this subdirectory to be visible.
i want the result like this:
www.mysite.com/index.html


Thanks in advance for your help
Best Regards
and thanks for making this extension free
L'Argomento è stato bloccato.

Re: redirect from subdirectory to 1 higher level 14 Anni, 1 Mese fa #1550

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi and thanks,
I understand what you want to do and let me say it's not so easy. I try to explain.

You have your site (files and folders) under a "subdirectory" of the web root, and the URL is www.mysite.com/subdirectory/.

Now what you would is to hide the "subdirectory" to any users. Just as example, an user should call www.mysite.com/forum.html?id=321&view=list, and he should receive the page with the real URL www.mysite.com/subdirectory/forum.html?id=321&view=list.

This can't be done with ReDJ, because it is installed into Joomla, and Joomla is under "subdirectory". If the call doesn't arrive on Joomla before, ReDJ can't manipulate it.

What you need is possible, but you should use (if possible) an Apache mod_rewrite directive on the web root. Something like this in .htaccess file:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^subdirectory/
RewriteRule (.*) /subdirectory/$1 [L]


I hope this helps. Let me know.

Regards,
Luigi
Ultima modifica: 14 Anni, 1 Mese fa Da admin.
L'Argomento è stato bloccato.
Ringraziano per il messaggio: flora

Re: redirect from subdirectory to 1 higher level 14 Anni, 1 Mese fa #1551

  • flora
  • Offline
  • Fresh Boarder
  • Messaggi: 15
Hello,

Thanks for your reply

actually i had tried what is posted on my host help center:
help.justhost.com/questions/90/How+do+I+make+a+subfolder+the+main+folder+for+my+main+domain%3F

i did the same for 2 websites i own.
one on
/public_html/domain1/subdirectory1/index.html
to
/public_html/domain1/index.html
it worked

but now, with my other domain,hosted on the same public_html:
on /public_html/subdirectory2/index.html
to /public_html/index.html
it works for the first page but not the other ones

PS, the first domain is built with Frontpage,
and the second with Joomla

i attached a printscreen from the control panel of my host. i took it after i edited the respective .htaccess
i hope it explains my situation

Qualcosa è nascosto agli ospiti. Effettua il login o registrati per vederlo.

thanks in advance for your help,
though i know it's not in the scope of the support of the extension....

Best Regards
L'Argomento è stato bloccato.

Re: redirect from subdirectory to 1 higher level 14 Anni, 1 Mese fa #1552

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi,
all is clear. So, I need that you send me the .htaccess file you create on the public_html folder.

Note that this is the ONLY file you need to configure. No needs to change .htaccess files located under subdirectory1 and subdirectory2 (if you did it, undo).

Luigi
Ultima modifica: 14 Anni, 1 Mese fa Da admin.
L'Argomento è stato bloccato.
Ringraziano per il messaggio: flora

Re: redirect from subdirectory to 1 higher level 14 Anni, 1 Mese fa #1554

  • flora
  • Offline
  • Fresh Boarder
  • Messaggi: 15
Hello,
a 1000 thank you for your concern

I sent you an email,
with the link to this topic as subject.

Best Regards
L'Argomento è stato bloccato.

Re: redirect from subdirectory to 1 higher level 14 Anni, 1 Mese fa #1555

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi Flora,
here is a clear description of your problem. I post it here so this can be useful for other users. Then I will send you a private message with the info you need.

You have a domain www.site.com with a document root set on folder public_html on the virtual host. You have installed Joomla on a subfolder named subdirectory1.
You have also configured .htaccess file in public_html folder, so that when a user calls the URL www.site.com/, he gets internally redirected to www.site.com/subdirectory1/, and the URL doesn't change, so the user doesn't notice the subdirectory1 part in the URL.

Now, the problem is that all the URLs that Joomla builds inside pages still contain the subdirectory1 part. And you just want to drop this.

To change the way Joomla builds URLs, first way is to change the document root to point to subdirectory1. But you can't do this because you don't have control on virtual host configuration. Your rewrite rule is not enough because you change the URI internally, but Joomla uses PHP_SELF or SCRIPT_NAME to set the base. So what is the solution?

Simple, just use the Joomla way to overrides the base path. Edit the configuration.php and change this parameter:

var $live_site = 'http://www.site.com/';


It works! Simple and effective.

Regards,
Luigi
Ultima modifica: 14 Anni, 1 Mese fa Da admin.
L'Argomento è stato bloccato.
Ringraziano per il messaggio: flora

Re: redirect from subdirectory to 1 higher level 14 Anni, 1 Mese fa #1556

  • flora
  • Offline
  • Fresh Boarder
  • Messaggi: 15
Tu sei molto gentile
I couldn't be any happier today

your fix sorted out 95% of my problems,

I run Virtuemart, and i noticed that links are still pointing to the old directory,
so i found out that I should go to the settings, tab "Security" , and fix Siteurl and Secure url

another issue appeared is when i type www.domain.com, it's fine,
but when i type www.domain.com/index.php, it goes to the index.php (the one i was putting on the root) in the public_html folder
i deleted the file, and this fixed the issue

However,
when i browse in some inner pages , for example www.domain.com/location1/cart.html, it doesn't always recognise the button "Home" as www.domain.com/
but as www.domain.com/location1/index.html

I will send the url i mean by email,
if you're still willing to help

Thanks again
and Best Regards
L'Argomento è stato bloccato.

Re: redirect from subdirectory to 1 higher level 14 Anni, 1 Mese fa #1567

  • flora
  • Offline
  • Fresh Boarder
  • Messaggi: 15
Update:

Luigi helped me solve the problem by mail,
the solution to my problem is this:
Just try to add a slash before index:

<a href="/index.php" title="<?php echo $siteName; ?>

It should solve.


Thanks Luigi, and
Regards
L'Argomento è stato bloccato.

Re: redirect from subdirectory to 1 higher level 14 Anni, 1 Mese fa #1571

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Thanks to you.

Regards,
Luigi
L'Argomento è stato bloccato.
Ringraziano per il messaggio: flora

Re: redirect from subdirectory to 1 higher level 14 Anni, 1 Mese fa #1608

  • flora
  • Offline
  • Fresh Boarder
  • Messaggi: 15
Hi,

Update:
I needed error messages sent to www.domain.com
to be handled by www.domain.com/subdirectory1
(sure, subdirectory1 still being invisible thanks to the previous rules followed in this thread )

so Luigi suggested that I add the following:

ErrorDocument 404 /subdirectory1/


in the .htaccess located in public_html
(not in the subdirectory1!)

this way, all error messages will be redirected to the subdirectory where you have already configured your error message

Thanks Luigi for the help
Regards

Stephanie
L'Argomento è stato bloccato.
  • Pagina:
  • 1
Moderatori: admin
Tempo generazione pagina: 0.64 secondi
Cerca con Google
News
Chi è online
 185 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.