Welcome Guest, Not a member yet? Register   Sign In
mod_rewrite for multiple applications
#31

[eluser]Aken[/eluser]
You could create a separate PHP file next to index.php (lets say rewrite.php), then change one of your RewriteRules to redirect to that script. Then you can see which one is going where at what times.

A CI generated 404 is typically a good thing, means the .htaccess is working (to a degree) and it's finding a file. Now you just have to make sure you know which one. Post up what you find if you still can't get it.
#32

[eluser]Kenneth Allen[/eluser]
[quote author="Aken" date="1333829985"]You could create a separate PHP file next to index.php (lets say rewrite.php), then change one of your RewriteRules to redirect to that script. Then you can see which one is going where at what times.

A CI generated 404 is typically a good thing, means the .htaccess is working (to a degree) and it's finding a file. Now you just have to make sure you know which one. Post up what you find if you still can't get it.[/quote]

OK, some more 'clues' as I experiment.

I using the .htaccess as you suggested with lowercased "small", I get the 404 error, and the root application log file contains that and indicates that it is only looking for SMaLL -- that may be because the invoking link has SMaLL in mixed case. This time I noticed that the SMaLL application log file has the following entry, which was not appearing before.

Code:
ERROR - 2012-04-07 16:21:22 --> Severity: Notice  --> unserialize(): Error at offset 0 of 276 bytes /Users/krallen/Sites/D2Trial/SMaLL/system/libraries/Session.php 724

So, I went to the .htaccess file, changed SMaLL to mixed case and emptied the log files -- when I attempt the test once more, the base SMaLL page is displayed even though the address bar contains my expected URL. This would seem to indicate to me that not all of the segments are being passed down to the SMaLL invocation. The root application log file was empty (confirming that it believed it process the URL correctly), but the SMaLL application log still contained the error noted above (which was not showing up before).

I do have database session management in both systems, but the root session are stored in one database and the SMaLL sessions are stored in another. Could this be another problem?

So, I tried dumping the $_SERVER object as the firstling in each of the index.php files, and here is what I see:

1. d2trial dumps only from the door index.php and the SCRIPT_FILENAME is /Users/krallen/Sites/D2Trial/index.php and the reQUEST_URI is /.

2. d2trial/SMaLL dumps only from the SMaLL/index.pho file, and the SCRIPT_FILNAME is /Users/krallen/Sites/D2Trial/SMaLL/index.php and the REQUEST_URI is /SMaLL/

3. d2trial/SMaLL/season/1 dumps only from the SMaLL/index.php file and the SCRIPT_FILENAME is still /Users/krallen/Sites/D2Trial/SMaLL/index.php, the REQUEST_URI is /SMaLL/season/1 and there is some new entries -- REDIRECT_URL is /SMaLL/season/1; PATH_TRANSLATED is redirect:/index.php/season/1/1. I am not certain why these last two are present when they were not in the others, but the extra /1 on the end looks suspicious. I do not see where that is coming from.

Thoughts?
#33

[eluser]Kenneth Allen[/eluser]
OK, I have resolved my issue -- there was one place where I was not properly detecting that the CI code was operating in development mode, and so a setting was being defined appropriate for the production/test hosting environment. Once I changed that, and placed the mixed case SMaLL in the root .htaccess file, pages from SMaLL started appearing properly.

For all of the ideas and directional nudges, thank you so much.




Theme © iAndrew 2016 - Forum software by © MyBB