I build codeigniter project and i have tested it in my local machine using http://works.dev/rcsoft as base url. I upload that project to cpanel and my new url like http://testsomeone.org/rcsoft. Home page is working.
But it is not working for other controller page such as http://testsomeone.org/rcsoft/person. It is giving
Not Found
The requested URL /index.php/person was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
But it working for http://testsomeone.org/rcsoft/index.php/person
my .htaccess file
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
My config.php
$config['base_url'] = 'http://testsomeone.org/rcsoft/';
$config['index_page'] = '';
Please help me. What is the issue?
First open up application/config/config.php file and edit line #17 as the example below:
$config['base_url'] = 'http://testsomeone.org/rcsoft/';
Second, insert the following line right after RewriteEngine On in .htaccess file:
RewriteBase /rcsoft/
Is it working fine in your local machine?..if so then just change the details in routing file..then try ..
Related
I have downloaded and using Codeigniter 3.1.11.
I have copied the same to as usual htdoc folder.
Tomcat is Binary Installed and service running and able to get
the Welcome page with http://localhost/CodeIgniter3111/index.php/welcome.
I have inserted in .htaccess as below.
RewriteEngine On
RewriteCond $1 !^(index\.php|assets|images|js|css uploads|fevicon.png)
RewriteCond %{HTTP_COOKIE} ais=([a-z0-9-_]+)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-f
RewriteBase /CodeIgniter3111/
RewriteRule ^(.*)$ ./index.php/$1 [L]
and also removed the index.php from Config.
$config['base_url'] = 'http://localhost/CodeIgniter3111'; and added the base url as well.
As I type in url (http://localhost/CodeIgniter3111/welcome), I am
getting below error in browser.
Not Found
The requested URL /CodeIgniter3111/welcome was not found on this server.
I appreciate support in advance.
$config['base_url'] = 'https://localhost:8888/Your folder name';
your port number should be there
I want to run the codeigniter project which I am currently working on in localhost I setup each and everythng accordingly
$config['base_url'] = 'http://localhost/site';
$config['index_page'] = '';
its works fine in my office but when i bought it home to work more on off days I started getting errors it only shows the home or index page and when i navigate to other pages it displays 404 object not found
just displays the home page all the other routes not working
please help
Reasons can be
You might have copied the code in different CodeIgniter version.
Some code standard differs from version to version.
Might be because of database.
Create .htaccess file and put below code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
I am having a problem after hosting my codeIgniter project on live shared hosting server.
Before doing that, I changed few things on my local server.
.htaccess file-
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
.config.php inside config folder-
$config['base_url'] = '';
$config['index_page'] = '';
to let it work properly on my local server without writing index.php in URL. But when I moved it to live server, I changed base_url as-
http://crm.sachinartani.com
as I am hosting it on my subdomain, but it always output-
404 Page Not Found
The page you requested was not found.
I watched all videos on YouTube and traversed all questions of StackOverflow but none of the solutions helped me. There is a folder aside application folder namely inc which contains CSS and JS files I am using in my project. I am able to access those files by URL as - http://crm.sachinartani.com/inc but I cannot access any controllers and views like this.
I wonder what is the difference between my page offline and online?
After downloading my page offline I need to add (index.php) after my folder file in order to make it viewable?
http://localhost/gsaconst/index.php/articles/news
my online page would be
http://www.gsa-constructionspecialist.com/articles/news
How to delete the index.php in the offline page and still make it viewable not error message like:
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
you need to add .htaccess file in offline directory
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
and also make sure you remove index.php from config file $config['index_page'] = 'index.php';
find config file application/config/config.php
I'm relatively new to CI and I'm wondering if anyone knows how to set the default page of CI. I just transferred my files from my local server to my remote server and am having some problems. Firstly, I think it's important to note that I edited the .htaccess file so that the index.php was removed from the URL.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Secondly, in my config.php file, I have:
$config['base_url'] = '';
$config['index_page'] = 'sportstream';
sportstream is the name of a controller that is found in the application/controllers/ folder. From my experiences without using CI (or any other framework), the index.php file inside of the public_html folder on the remote server is the one that is loaded by default upon visiting a site. But, with CI, whenever I try to visit my domain name, a 404 error is returned. I have tried setting to base_url to http://www.mysite.com without any luck.
Does anyone here know how to make it so that upon visiting http://www.mysite.com that http://www.mysite.com/sportstream will be loaded?
You need to add a RewriteBase in your .htaccess file:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
NOTE: I have added a ? after the index.php as well.
I would also set the follow to an empty string (after you have tried the above):
$config['base_url'] = '';
$config['index_page'] = '';
Finally, in your routes.php file:
$route['default_controller'] = 'sportstream';
Update
In application/config/database.php you need to change your database driver. On your localhost, MySQLi was the database driver set. On your remote server, however, MySQLi was not installed, so changing it to MySQL should fix the issue.
//old - works on local server
$db['default']['dbdriver'] = 'mysqli';
//new - works on remote server
$db['default']['dbdriver'] = 'mysql';
For some reason, Codeigniter just "breaks" and shows the blank screen with no errors.
You have to set default controller in $route['default_controller'] ="sportstream"; it is located in aplication/config/route.php, So when visitinghttp://www.mysite.com/thesportstream` controller will be loaded by default.
Check about default controller in User guide
Switch back the $config['index_page'] = '';
If you renamed the index.php then you must enter the index_page name in config or else you can keep it blank.
Recommended Codeigniter starter guide: http://net.tutsplus.com/tutorials/php/codeigniter-basics/