Welcome Guest, Not a member yet? Register   Sign In
multi-app, multi-problem
#1

[eluser]vecima[/eluser]
Hello everyone,

I just recently uploaded a bunch of files to my live server to update my website. I have all of this working on my xampp (localhost). live server is on DreamHost.

[EDIT]
if anyone's interested the live site (including the problem) can be seen here:

http://type3studios.com/civilization/index.php

in my post, substitute domain.com with type3studios.com and application2 with civilization
[/EDIT]

My live server site layout is thus: (files are bold blue)

Quote:root/
----domain.com/
--------system/
------------(system_stuff)
--------application1/
------------config/
------------controllers/
------------models/
------------views/
------------(etc)
--------application2/
------------config/
------------controllers/
------------models/
------------views/
------------(etc)
------------index.php
--------css/
--------images/
--------js/
--------index.php
--------.htaccess
----uploads/


It's a multi-application. the way it works with CI is like so:

in root/domain.com/.htaccess:
Code:
RewriteEngine On
RewriteCond $1 !^(index\.php|svn|failed_auth\.html|images|downloads|js|css|application2|forum2|star_rating|lytebox|tinymce|robots\.txt)
RewriteRule ^(.+)$ index.php?$1 [L]
if i remove |application2 from the .htaccess, then i get
domain.com/application2 = Directory access is forbidden.
domain.com/application2/index.php = 404
domain.com/application2/index.php? = 404

on my localhost, my .htaccess looked like this:
Code:
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

I've never been able to use the same .htaccess on localhost as on the live server.

in root/domain.com/index.php:
Code:
$system_folder = "system";
$application_folder = "application1";

in root/domain.com/application2/index.php:
Code:
$system_folder = "../system";
$application_folder = "../application2";

so, on essentially requests should go like this:

http://www.domain.com/
should give you application1 (because it's set in the root/domain.com/index.php)

http://www.domain.com/application2
should give you application2

what I'm getting is:

http://www.domain.com/
works as expected

http://www.domain.com/application2
gives: Directory access is forbidden.

http://www.domain.com/application2/index.php
or
http://www.domain.com/application2/index.php?
gives: application2

http://www.domain.com/application2/controller
gives: 404 Page Not Found (with codigniter styling)

http://www.domain.com/application2/index.php/controller
gives: No input file specified.

http://www.domain.com/application2/index...controller
gives: application2/controller

The thing is, I don't want a ? in the URL. I don't even want the /index.php/ in the URL, but I was going to settle with it, because I haven't seen a way to do a multi-app without having /index.php/ in the URL. at any rate, on my localhost I didn't have any of these problems. domain.com/application2 gave me the same thing as domain.com/application2/index.php (the main controller for application2). and I didn't need a ? in the URL.

I'm not very good with .htaccess, so I'm not even sure if that's the problem (though it seems like it). Does anyone here have an Idea?
#2

[eluser]vecima[/eluser]
bump!

This hit page 2, and I didn't want it to get overlooked when the pros get back from their weekends of debauchery.
#3

[eluser]vecima[/eluser]
I've changed the layout of the applications slightly. I now have each application's index.php residing within the application's folder. I have an index.php for the domain that basically says "which codeigniter app would you like to use?" and has links to both. For clarity's sake, the outer index.php could be an index.html... it doesn't actually need any php code. It's just links to the CI apps.

so like this:
Quote:root/
----domain.com/
--------system/
------------(system_stuff)
--------application1/
------------config/
------------controllers/
------------models/
------------views/
------------(etc)
------------index.php
--------application2/
------------config/
------------controllers/
------------models/
------------views/
------------(etc)
------------index.php
--------css/
--------images/
--------js/
--------index.php
--------.htaccess
----uploads/

again, this works wonderfully on my local server.

WHY IN THE FLYING &%&*ING NAME OF ALL THAT IS $%()#&%)&@#$@#$@#$@#$ would this not work on the live server?
I've tried using the same .htaccess i have locally, I've tried just modifying the one I have live,
and I've tried a bunch in between.

I've gotten it to the point where one app works, but the other doesn't... how can that be when the only difference is their name, and they're both treated the same in the .htaccess?

In a perfect world, I'd be able to get these two apps working, and rid the URL of /index.php/ for both of them, but for now, I'll just settle for getting them working at all.

does anyone have any thoughts? I feel like I'm ranting like a madman at this point... I put a ton of work into the code, and now that it's live the site is broken!
#4

[eluser]John_Betong[/eluser]
 
Maybe this will help or at least get you thinking in the right direction.

http://johns-jokes.com/_menu.php

I have multiple applications running on one of my sites that you can test in the above link.

The menu sets a $_SESSION['_MENU_'] variable and then calls index.php using header('Location: index.php');

The standard CodeIgniter index.php:
Code:
$application = isset($_SESSION['_MENU_']) ? $_SESSION['_MENU_'] : 'ci_jokes';
#5

[eluser]vecima[/eluser]
John, thanks for replying,

I've actually seen that site before (are you the only other person who uses multiple applications? Wink ), but it's a little bit different from what I'm going for.

I've got the site at least working. the URLS have /index.php?/ and I'd like to remove that, but It's less of an urgent concern now.




Theme © iAndrew 2016 - Forum software by © MyBB