问题
My website was hosted on domain seeingtheworld.org and my htaccess
was as follows:
php_value upload_max_filesize 1024M
php_value post_max_size 1024M
php_value max_execution_time 2700
php_value max_input_time 2700
Options +FollowSymlinks
RewriteEngine On
RewriteBase /seeingtheworld
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
This is the link working fine. http://seeing-the-world.org/
Now I have hosted this site on openshift
http://stw-ciapps.rhcloud.com/
It is only opening the home page and no other page. As I have specified home as default controller and do not know what I should change in htaccess
for this openshift.
If I have htaccess then why default root
回答1:
check with this code to your htaccess.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</Ifmodule>
if its still not workings,try with changing "uri_protocol" in config file.
回答2:
Turns out my problem was somewhat unrelated. I had to rename my default controller php file to lowercase and the controller class name to lowercase and everything started to work. When CI looks for the default controller file, it searches in lowercase for the file; if I name my controller file "Home.php" instead of "home.php," CI misses it on Linux (since Linux file systems are case sensitive).
来源:https://stackoverflow.com/questions/30240994/php-codeigniter-application-not-opening-any-page-except-default-controller