Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter is not working on Goddady server
#1

[eluser]cmgmyr[/eluser]
Hey all,
One of my clients insisted on hosting with GoDaddy instead of me, and now I'm having some issues that are hopefully quick fixes.

I have followed this: http://codeigniter.com/wiki/Godaddy_Installaton_Tips/ to get everything up and running, but I can't get off the first page. When you click links you see the URL changing but the page doesn't go to the correct file. My htaccess is:
Code:
# Deny OR Allow Folder Indexes.
# Since we disable access to PHP files you
# can leave this on without worries.
# OR better yet, create a .htaccess file in
# the dir you want to allow browsing and
# set it to +Indexes
Options -Indexes

Options +FollowSymLinks

# Set the default file for indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    # mod_rewrite rules
    RewriteEngine on

    # The RewriteBase of the system (if you are using this sytem in a sub-folder).
    RewriteBase /new
    
    RewriteCond %{HTTP_HOST} ^mydomain.com/new [NC]
    RewriteRule ^(.*)$ http://www.mydomain.com/new/$1 [L,R=301]
    
    # If a controler can't be found - then issue a 404 error from PHP
    # Error messages (via the "error" plugin)
    # ErrorDocument 403 /index.php/403/
    # ErrorDocument 404 /index.php/404/
    # ErrorDocument 500 /index.php/500/
    
    # Deny any people (or bots) from the following sites: (to stop spam comments)
    # RewriteCond %{HTTP_REFERER} nienschanz\.ru [NC,OR]
    # RewriteCond %{HTTP_REFERER} porn\.com
    # RewriteRule .* - [F]
    # Note: if you are having trouble from a certain URL just
    # add it above to forbide all visitors from that site.

    # You can also uncomment this if you know the IP:
    # Deny from 192.168.1.1
    
    # If the file is NOT the index.php file
    RewriteCond %{REQUEST_FILENAME} !index.php
    # Hide all PHP files so none can be accessed by HTTP
    RewriteRule (.*)\.php$ index.php/$1
    
    # If the file/dir is NOT real go to index
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
    
</IfModule>

# If Mod_ewrite is NOT installed go to index.php
<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php
</IfModule>

Since the site isn't live yet it is in the "new" directory.

Any help is greatly appreciated.

Thanks,
-Chris
#2

[eluser]louis w[/eluser]
I am in the midst of setting a client up on Go Daddy too. I can tell you this - I will never do it again. What a headache.

I have it half working. Two things to note. Make sure you have $config['uri_protocol'] = "QUERY_STRING"; in the config

And change your rewrite to:
RewriteRule (.*)\.php$ index.php?$1

Notice the ?... it appears Go Daddy does not like the normal way that CI passes the uri (index.php/my/page) so this will pass it instead as index.php?my/page

Another thing to know is that any changes to htaccess "might not take effect for up to an hour" which makes debugging a problem VERY HARD.
#3

[eluser]louis w[/eluser]
To update you on my situation.

This is my htacces:

Code:
Options -MultiViews +FollowSymLinks

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !index.php
RewriteRule ^(.*) /index.php?$1 [L]


Requests to /test.php successfully map to my index
Requests to /test DO NOT redirect

It appears that requests to a directory will not map, but requests with an extension will.

I called Go Daddy and the tech looked around a bunch. He even spoke with a higher level support person. They decided that it appears to be some kind of server site configuration or security restriction which is causing the problem - nothing I did. They wanted to send the ticket up to a higher level tech (who I was not allowed to speak to on the phone). I would get a response from them anywhere from 24 to 72 hours later.

Long story short - GO DADDY SUCKS. I am switching hosts. This is absurd.
#4

[eluser]wiredesignz[/eluser]
This htaccess will most likely work for you and allows you to use both segments and query strings.

http://ellislab.com/forums/viewthread/96347/

Add your own final RewriteCond{s) to suit.
#5

[eluser]louis w[/eluser]
I tried this on my client's GoDaddy shared account and it did the same as my previous attempts. Urls with extensions work fine, but directories do not get re-written and instead see the "Ooops" page (even though my setting say not to use to GoDaddy custom 404 page).

To update my previous post. Over 24 hours later I got this repose:


Quote:...

However, entering a URL that lacks a file extension or trailing slash does return our default Oops! page. This behavior is the result of how our systems are configured and cannot be modified with any settings within your Hosting Control Center. You may be able to change this behavior with additional rewrite rules in your .htaccess file, or through settings within a web.xml file in your WEB-INF directory. Unfortunately, Hosting Support would not be able to provide assistance for using either method, so you may wish to do a web search on the topic for additional information.


I am moving my client off of GoDaddy next week. Any time a client tells me they use this host we will be requiring them to switch to a more competent host being we upload anyhting.
#6

[eluser]jamie young[/eluser]
FYI, I just went though this GoDaddy nightmare and got this .htaccess file to work. It was a lot larger since I was adding in everything that I could find that anyone has ever said to make it work. Once I got it working, I started removing entries to see what the minimum needed was, below is what I ended up with. It is important to note I had to remove all GET requests that I was using, converting them all to POST, that and the .htaccess below seemed to be the magic for me to have a CI install working on GoDaddy servers.

Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>

In my config.php, index_page is blank and uri_protocol is AUTO

BTW, after finding this thread I tried out what wiredesignz linked in comment #3. It is a better solution than what I have above and works just fine on GoDaddy server.
#7

[eluser]louis w[/eluser]
I have a feeling there must be differences in server platform and configuration between what my client had and you.

Nevertheless, I was less then impressed with GoDaddy's capabilities and service. I will never use them again and steer any client in another direction.
#8

[eluser]paulon[/eluser]
i got a same problem once in godaddy.com but i already fix it.
if you have .htaccess

change your
$config['uri_protocol'] = "REQUEST_URI";
$config['index_page'] = "";

and the .htaccess
Code:
# Deny OR Allow Folder Indexes.
# Since we disable access to PHP files you
# can leave this on without worries.
# OR better yet, create a .htaccess file in
# the dir you want to allow browsing and
# set it to +Indexes
Options -Indexes

Options +FollowSymLinks

# Set the default file for indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    # mod_rewrite rules
    RewriteEngine on

    # The RewriteBase of the system (if you are using this sytem in a sub-folder).
    # RewriteBase /site_folder/
    
    # This will make the site only accessible without the "www."
    # (which will keep the subdomain-sensive config file happy)
    # If you want the site to be accessed WITH the "www."
    # comment-out the following two lines.
    # RewriteCond %{HTTP_HOST} ^www\.site\.com$ [NC]
    # RewriteRule ^(.*)$ http://site.com/$1 [L,R=301]
    
    # If a controler can't be found - then issue a 404 error from PHP
    # Error messages (via the "error" plugin)
    # ErrorDocument 403 /index.php/403/
    # ErrorDocument 404 /index.php/404/
    # ErrorDocument 500 /index.php/500/
    
    # Deny any people (or bots) from the following sites: (to stop spam comments)
    # RewriteCond %{HTTP_REFERER} nienschanz\.ru [NC,OR]
    # RewriteCond %{HTTP_REFERER} porn\.com
    # RewriteRule .* - [F]
    # Note: if you are having trouble from a certain URL just
    # add it above to forbide all visitors from that site.

    # You can also uncomment this if you know the IP:
    # Deny from 192.168.1.1
    
    # If the file is NOT the index.php file
    RewriteCond %{REQUEST_FILENAME} !index.php
    # Hide all PHP files so none can be accessed by HTTP
    #RewriteRule (.*)\.php$ index.php/$1
    
    # If the file/dir is NOT real go to index
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteCond %{REQUEST_URI} !/admin_asset
    RewriteRule ^(.*)$ index.php/$1 [L]
    
</IfModule>

# If Mod_ewrite is NOT installed go to index.php
<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php
</IfModule>

it works on me..

hope it helps.

please note that the problem here is not in godaddy.com but its in your script...




Theme © iAndrew 2016 - Forum software by © MyBB