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

Redirect to correct directory
(1 Online) (1) Ospite
  • Pagina:
  • 1

ARGOMENTO: Redirect to correct directory

Redirect to correct directory 14 Anni, 6 Mesi fa #1224

  • bmheck
  • Offline
  • Fresh Boarder
  • Messaggi: 4
Just started using ReDJ and it looks great! But I need help with one issue:

We have a production version and a development version of our Website. Each is in a different directory like this:

public_html/production/
public_html/development/

I installed ReDJ in the development version and found that I have to modify the .htacess file to make it work by adding the line:

# ErrorDocument 404 /development/

But .htaccess is in the public_html directory, which is the parent directory for both versions. So if someone hits a 404 error in production, the rule created on the development side is applied and the user is taken into the development version. Of course, I could change the line in .htaccess to refer to production rather than development, but then a user in the development version would end up in the production version.

The item that I created in the development version is like this:

FROM: /avidbirders
TO: columbusaudubon.org/development/index.php?option=com_content&view=article&id=3&Itemid=5

I also tried making the TO URL into:
http://{siteurl}/index.php?option=com_content&view=article&id=3&Itemid=5

but it appears that {siteurl} refers to the location where the rule is housed, not the location where the request originates.

No doubt there is a way to be version-specific, and I looked through this forum for a solution, but as a newbie I have not found it.

By the way, we occasionally update the development version by copying the production version to the development directory. So ideally any solution would work by figuring out where the request originates.

Any help is greatly appreciated!
L'Argomento è stato bloccato.

Re:Redirect to correct directory 14 Anni, 6 Mesi fa #1228

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Ok,
tell me if I'm wrong but I get the same page with all the following URLs:

http://columbusaudubon.org/development/index.php?option=com_content&view=article&id=3&Itemid=5
http://columbusaudubon.org/production/index.php?option=com_content&view=article&id=3&Itemid=5
http://columbusaudubon.org/index.php?option=com_content&view=article&id=3&Itemid=5


So, to suggest you the best solution, first I need to know how you "map" the live site no "/production" subfolder (e.g. a virtual host).

Luigi
L'Argomento è stato bloccato.

Re:Redirect to correct directory 14 Anni, 6 Mesi fa #1229

  • bmheck
  • Offline
  • Fresh Boarder
  • Messaggi: 4
The development version is a snapshot copy of the production system. So the URLs that you list point to one of two copies of the page, either in the production version or the development version, as follows:

columbusaudubon.org/development/index.php?option=com_content&view=article&id=3&Itemid=5 <-- birders page in the development version (note "development" in the URL)

columbusaudubon.org/production/index.php?option=com_content&view=article&id=3&Itemid=5 <-- birders page in the production version (note "production" in the URL)

columbusaudubon.org/index.php?option=com_content&view=article&id=3&Itemid=5 <-- also birders page in the production version

The last one points to production because the .htaccess file contains a redirect that points any URL with just "columbusaudubon.org" (not followed by a directory name) to the production version. The .htaccess file is generated by a front-end piece on our host -- if you want to see .htaccess, I can send it.

I hope that makes sense!

Thanks,
Bill
L'Argomento è stato bloccato.

Re:Redirect to correct directory 14 Anni, 6 Mesi fa #1230

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Ok,
it makes sense. So, assume that the rule related to "production" is the best solution (maybe a better solution could be "virtual hosts").

In any case you have two Joomla installations, the first has /production as root folder, and the second root folder is /development.

It should be possible to have a .htaccess in any root. So, just put the following in /development/.htaccess:

ErrorDocument 404 /development/

It should work,
Luigi
Ultima modifica: 14 Anni, 6 Mesi fa Da admin.
L'Argomento è stato bloccato.

Re:Redirect to correct directory 14 Anni, 6 Mesi fa #1237

  • bmheck
  • Offline
  • Fresh Boarder
  • Messaggi: 4
Tried that, and it does behave differently, but rather oddly. That is, the .htaccess file in /production/ does *not* include the needed statement, but the one in /development/ does -- and errors are redirected in both versions! But they are redirected to the correct system, i.e., redirects from the production version go back to production, and those from development go back to development. That makes some sense because the TO URL contains the macro rather than the domain name. But I don't understand how the production side does redirects at all because the .htaccess file there does not have the needed line. I'll investigate some more.

In any case, we can focus on the production side so that it always works properly. If there are any glitches on the development side, we can live with them.

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

Re:Redirect to correct directory 14 Anni, 6 Mesi fa #1238

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Maybe the /production site is handled by a directive on the root folder so, check if there's a .htaccess file in the / folder.

Luigi
L'Argomento è stato bloccato.

Re:Redirect to correct directory 14 Anni, 6 Mesi fa #1241

  • bmheck
  • Offline
  • Fresh Boarder
  • Messaggi: 4
I should have clarified: did that already. That is, there was an .htaccess file in the root. I got rid of it and placed .htaccess files in /production/ and /development/ (one copy in each). The one in /development/ is the one that I modified.

BTW, I am looking into virtualization to see if we can eliminate this issue at the source. The way we have it set up now probably is not the best arrangement.

Thanks!
L'Argomento è stato bloccato.

Re:Redirect to correct directory 14 Anni, 6 Mesi fa #1245

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Let me know if you need some help.

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