PDA

View Full Version : redirecting index.php to another folder



jawnski
06-18-2007, 09:33 AM
Hi,

I installed surgarcrm in /public_html/ and joomla! in public_html/portal/

So when users go to mydomain.com the sugar login shows up instead of the home page in /portal. So what I did was put an html file in public_html/ so users can choose to go to sugar or to /portal/index.php but it's not really what I want.

Hope this makes sense.

Anyway, how can a guy edit the index.php file in public_html/ to redirect to the /portal/index.php so when users go on mydomain.com they see /portal/index.php?

Thanks,

John

Pethens
06-18-2007, 09:42 AM
If you do that, how will people ever get to sugar crm?

Better idea:
1. install sugar crm in /public_html/crm
2. install joomla in /public_html/portal (you did this already)
3. install a redirect in public_html that points to the directory of your choice. You can do this with php or mod_rewrite.

jawnski
06-18-2007, 10:09 AM
Thanks, Pethens. Putting sugar in it's own directory is the way to go on this but I just wanted to avoid the install since it takes forever. But in the long term it'll be worth it.

Thanks for the tip!

The install to /crm was painless, and all I have in the .htaccess is DirectoryIndex /portal/index.php and it has done the trick. Not sure, however, how this will affect SEO. Funny thing, though, is when I go to mydomain.com/crm/ it takes me to mydomain.com/portal/index.php

Cheers,

John

Pethens
06-18-2007, 01:31 PM
Funny thing, though, is when I go to mydomain.com/crm/ it takes me to mydomain.com/portal/index.php


Your directoryindex could be causing that. Try removing it from your .htaccess and add instead:


RewriteEngine on
RewriteBase /
RewriteRule ^$ portal/ [R=301,L]

jawnski
06-18-2007, 02:18 PM
You know something, Pethens, you are a saint. Thanks for the bit of code you shared. It works perfeclty!

granun
06-19-2007, 03:29 AM
Your directoryindex could be causing that. Try removing it from your .htaccess and add instead:


RewriteEngine on
RewriteBase /
RewriteRule ^$ portal/ [R=301,L]



Thankyou for this sugguestion It's cool