CodeIgniter Forums
'welcome' not showing up as expected - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: 'welcome' not showing up as expected (/thread-11196.html)

Pages: 1 2


'welcome' not showing up as expected - El Forum - 08-29-2008

[eluser]NateL[/eluser]
I did a fresh upload to a folder on my domain, mydomain.com/test

However, when I go to mydomain.com/test, I get the CI 404. when I go to mydomain.com/test/welcome, i get the proper welcome page that comes with CI

for my .htaccess, I have this code:
Code:
Options -indexes
DirectoryIndex index.php
RewriteEngine On
RewriteBase /test/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L]

config.php:
$config['base_url'] = "http://mysite.com/test/";

routes.php
$route['default_controller'] = "welcome";

Everything else is pretty much default...

When I go to mysite.com/test, am I supposed to see Welcome first? or is everything set up properly if I go to mysite.com/test/welcome ?


'welcome' not showing up as expected - El Forum - 09-02-2008

[eluser]NateL[/eluser]
bump. still not sure what's goin on Sad


'welcome' not showing up as expected - El Forum - 09-02-2008

[eluser]Randy Casburn[/eluser]
Hi, Try a slash after the ? after index.php thus:

index.php?/$1

Randy


'welcome' not showing up as expected - El Forum - 09-02-2008

[eluser]NateL[/eluser]
No, still not seeing the welcome page. I'm only trying to get it so that I type in mysite.com/test and the welcome page shows up. I'm confused about why I have to type in mysite.com/test/welcome (which works) but I've told CI to automatically bring in 'welcome' as the main page...and yet, I get a CI 404 if I don't type anything after test/


'welcome' not showing up as expected - El Forum - 09-02-2008

[eluser]Randy Casburn[/eluser]
This has to do with:

the differences between your HTTP server platforms in the two locations

Plus...

Quote:|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of "AUTO" works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO' Default - auto detects
| 'PATH_INFO' Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI' Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = "AUTO";


Plus...

Quote:RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+) index.php/$1 [L]

----
You've got to discover the differences and work only on the differences. Otherwise you're stabbing in the dark.

Randy


'welcome' not showing up as expected - El Forum - 09-02-2008

[eluser]NateL[/eluser]
My apologies, I'm not sure what the next step is ... :blank:


'welcome' not showing up as expected - El Forum - 09-02-2008

[eluser]LuckyFella73[/eluser]
You could test an other htaccess:
Code:
<IfModule mod_rewrite.c>
    # Turn on the Rewrite Engine
    RewriteEngine On
    
    # If the file or directory exists, show it
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+) - [PT,L]
    
    # Blank queries get sent to the index
    RewriteRule ^$ index.php [L]
    
    # All other queries get sent to the index as index.php/whatever
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

It works on the most servers I had a CI project.
I didn't have to define a RewriteBase even if the project was
placed in a subfolder. I'm no htaccess pro but you could
give it a try ..


'welcome' not showing up as expected - El Forum - 09-02-2008

[eluser]Randy Casburn[/eluser]
@Nate - are the setttings I highlighted above EXACTLY the same on both the hosted server and your localhost?

That's where you start. Look at the config.php, look at the htaccess file, look at the http.conf file for apache and compare all the settings.

You have to find the differences between the two servers.

Come back and report the differences. If software works in one spot and not in another, you have to determine the differences between the two spots. It's pretty straight forward.

The other option, as LuckyFella73 has offered, is to start stabbing in the dark at all these files until you completely screw everything up and get even more frustrated.

Those are you options and starting places.

Randy


'welcome' not showing up as expected - El Forum - 09-02-2008

[eluser]phpoet[/eluser]
Also, make sure you have mod_rewrite installed/enabled on your server. You can check this by creating a &lt;?php phpinfo() ?&gt; page and looking under the section apache2handler in the loaded modules section.


'welcome' not showing up as expected - El Forum - 09-02-2008

[eluser]KaBaDaBrA[/eluser]
You can also try this in the .htaccess file located on your server's root directory:

Code:
RewriteEngine On

RewriteCond $1 !^(index\.php|images|robots\.txt|css|sitemap\.xml)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

php_flag register_globals on