Welcome Guest, Not a member yet? Register   Sign In
Problems in CI online
#1

Hello guys,
I use CI local in my server and also in my clients.
I'm making a website to use as presentation to find new customers.
But I'm getting some issues. I couldnt to discovery the origin of the problem yet.
My bet is the temporary address, but no sure.
Hope you can help me.

I am hosting at hostgator

Follow some relevant snippets:

.htaccess
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]


config.php
PHP Code:
$config['base_url']    = 'http://108.167.188.23/~phpfr697/';
$config['index_page'] = '';
$config['uri_protocol']    = 'REQUEST_URI'

routes.php
PHP Code:
$route['default_controller'] = "login";  
$route['login'] = "login/index";  
$route['404_override'] = ''


I am getting 404 error at index root at http://108.167.188.23/~phpfr697
When I try to go to http://108.167.188.23/~phpfr697/login manually, the page redirects to some hostgator 404 page.

Thanks and sorry my bad english. I'm from Brazil and still learning.
Reply
#2

(This post was last modified: 12-08-2014, 08:58 PM by bclinton.)

what if you include your project directory in your rewrite rule?


Code:
  RewriteRule .* /~phpfr697/index.php/$0 [PT,L]
Reply
#3

(12-08-2014, 08:57 PM)bclinton Wrote: what if you include your project directory in your rewrite rule?

Code:
  RewriteRule .* /~phpfr697/index.php/$0 [PT,L]

So... now the / and /login are getting codeigniter 404 error (not the hostgator 404 error in /login).
But still 404 error lol
Thanks anyway. It's the first attempt. I ll keep searching to find a solution.
Reply
#4

Have you tried using a blank base_url:

PHP Code:
$config['base_url']    = ''

Even on a shared hosting, this should work fine.
Reply
#5

(12-08-2014, 02:25 PM)juninhodeluca Wrote:
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

You should change $0 to $1.

(12-08-2014, 02:25 PM)juninhodeluca Wrote:
PHP Code:
$config['base_url']    = 'http://108.167.188.23/~phpfr697/';
$config['index_page'] = '';
$config['uri_protocol']    = 'REQUEST_URI'

'index_page' should be 'index.php'.

(12-08-2014, 02:25 PM)juninhodeluca Wrote:
PHP Code:
$route['default_controller'] = "login" 
$route
['login'] = "login/index" 
$route
['404_override'] = ''

Not an issue, but your 'login' route is kind of pointless. 'index' is the default method even if you don't set it in a route.

(12-08-2014, 08:57 PM)bclinton Wrote: what if you include your project directory in your rewrite rule?

Code:
  RewriteRule .* /~phpfr697/index.php/$0 [PT,L]

Or rather, use RewriteBase.

(12-09-2014, 10:46 AM)Chroma Wrote: Have you tried using a blank base_url:

PHP Code:
$config['base_url']    = ''

Even on a shared hosting, this should work fine.

Please don't suggest this, an empty base_url only works so that beginner users can have close to zero configuration, but otherwise it should always be set, especially in a production environment.
Reply
#6

(This post was last modified: 12-10-2014, 08:03 AM by juninhodeluca.)

I cant leave it blank since I use base_url() helper a lot in the app.
I am waiting the dns propagation to try do with no temp folder.
Reply
#7

(12-10-2014, 03:34 AM)Narf Wrote:
(12-09-2014, 10:46 AM)Chroma Wrote: Have you tried using a blank base_url:


PHP Code:
$config['base_url']    = ''

Even on a shared hosting, this should work fine.

Please don't suggest this, an empty base_url only works so that beginner users can have close to zero configuration, but otherwise it should always be set, especially in a production environment.

I didn't know that.  Why?  Also, should it be a full url or relative?
Reply
#8

So... resolved guys. Thank you all.
After the DNS propagation, I still got the 404 error.
Googling a lot, noticed the point: linux based server are case-sensitive (duh!?)
Sometimes I feel myself like a... nevermind hehe
TY again!
Reply
#9

(This post was last modified: 12-11-2014, 03:09 AM by Narf.)

(12-10-2014, 11:05 AM)bclinton Wrote:
(12-10-2014, 03:34 AM)Narf Wrote:
(12-09-2014, 10:46 AM)Chroma Wrote: Have you tried using a blank base_url:



PHP Code:
$config['base_url']    = ''

Even on a shared hosting, this should work fine.

Please don't suggest this, an empty base_url only works so that beginner users can have close to zero configuration, but otherwise it should always be set, especially in a production environment.

I didn't know that.  Why?  Also, should it be a full url or relative?

Because you're otherwise relying on guesswork from the framework. Guesswork is never good, especially in this case where the value is static and you know it. It should be the full base URL, like shown in the config itself.
Reply
#10

Hey man,

Did you try to change back the uri_protocol config to 'AUTO' or one of the other modes? I think 'REQUEST_URI' is almost always working on a local installation, but it can be different on some servers.

Hope it helps...

-Roger
Reply




Theme © iAndrew 2016 - Forum software by © MyBB