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

[eluser]Aken[/eluser]
Try adding the SMaLL directory to the list of things to ignore in your root .htaccess

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|Assets|Documents|Tutorials|Photos|Temp|SMaLL)
RewriteRule ^(.*)$ /index.php/$1 [L]
#22

[eluser]Kenneth Allen[/eluser]
[quote author="Aken" date="1333824018"]Try adding the SMaLL directory to the list of things to ignore in your root .htaccess

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|Assets|Documents|Tutorials|Photos|Temp|SMaLL)
RewriteRule ^(.*)$ /index.php/$1 [L]
[/quote]

I tried that but it did not seem to have any effect. The URL did make it to the SMaLL area (the page rendered is for SMaLL, but it invokes the default path, so it seems that nothing is being passed along.
#23

[eluser]CroNiX[/eluser]
Did you set the proper path for /system and /application directories in your /small/index.php file?
#24

[eluser]Kenneth Allen[/eluser]
[quote author="CroNiX" date="1333825138"]Did you set the proper path for /system and /application directories in your /small/index.php file?[/quote]

Are they not relative to the location of the index.php file? THis is the documented value and what was used before and currently (the index.php file just specifies the name of the folders).

Or are they relative to the root folder of the web site? It does not appear so since if I change them to SMaLL/system and SMaLL/application respectively, I get this error:
Code:
Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php
#25

[eluser]Aken[/eluser]
They default to relative to the index.php. That should be fine. I think you're just getting conflicting .htaccess things.

Try removing your SMaLL .htaccess and replace the root one with this:

Code:
RewriteEngine on

RewriteCond $1 !^small/(assets|documents|tutorials|photos|temp)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^small(.*)$ /small/index.php/$1 [L]

RewriteCond $1 !^(assets|documents|tutorials|photos|temp)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

I'd recommend using lowercase rules - when doing some testing I got some unexpected results using capital letters. You can set case insensitivity if need be if issues still crop up.
#26

[eluser]Kenneth Allen[/eluser]
I made the changes you suggested, and I can still get to the default SMaLL page (trial.mysitename.com/SMaLL works, but any attempts to add segments (e.g., trial.mysitename.com/dosomething/1) results in this in the log file:
Code:
404 Page Not Found --> SMaLL
#27

[eluser]Aken[/eluser]
Okay but what is being displayed on the browser when you add a segment? Are you positive you've removed any conflicting .htaccess files?
#28

[eluser]Kenneth Allen[/eluser]
[quote author="Aken" date="1333827241"]Okay but what is being displayed on the browser when you add a segment? Are you positive you've removed any conflicting .htaccess files?[/quote]
The address bar in the browser displays the URL expected: trial/mywebsite.com/SMaLL/dosomething/1

The page in the browser displays
Code:
404 Page Not Found
The page you requested was not found.

I have only one .htaccess file, which is in the root folder; I renamed the one in the SMaLL folder to my.htaccess
#29

[eluser]Aken[/eluser]
Is the 404 page generated by the server or CI? Is the URL you're testing a valid URL? Obviously if you're testing a junk URL, you're gonna get a 404 error...
#30

[eluser]Kenneth Allen[/eluser]
[quote author="Aken" date="1333828660"]Is the 404 page generated by the server or CI? Is the URL you're testing a valid URL? Obviously if you're testing a junk URL, you're gonna get a 404 error...[/quote]
It certainly looks like a CI generated error, and the same information is showing up in the CI log file in the ~/application/Logs folder (that is, the root CI and not the SMaLL CI), as I mentioned earlier.

How can I trace what the RewriteRule does and the path it takes in processing?




Theme © iAndrew 2016 - Forum software by © MyBB