Welcome Guest, Not a member yet? Register   Sign In
htaccess works on home server but not on hosting account
#1

[eluser]Ludatha[/eluser]
Hello, I have my own server (a box running windows with WAMP on it Tongue)
My CodeIgniter site runs fine on the box, but when I uploaded it to my hosting account the htaccess doesn't work, they use Apache 1.2 or 1.3, can't remember. I have apache 2.


On my hosting account, the only to see anything is to go to
http://ludatha.com/index.php/profile/

with the index.php in it, with it, I get a 404, not by codeigniter.

I also can't get to the homepage at
http://ludatha.com/

but I can with the index on the end


This is the htaccess file:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|clients|upload|images|themes|test|js|css|jessicademattos)
RewriteRule ^(.*)$ /index.php/$1 [L]


Can anyone help?

- Adam
#2

[eluser]Mike L[/eluser]
Try this instead

Code:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond $1 !^(index\.php)
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]

That should work fine.

Also, if you installed your site in a sub directory (ex: http://example.com/mysite) add "mysite" to the end of RewriteBase like this:

Code:
RewriteBase /mysite
#3

[eluser]nzmike[/eluser]
Perhaps mod_rewrite is not enabled in apache.

Make a file that prints out the function phpinfo().

e.g.

Code:
<?php
   echo phpinfo();
?>


Under Loaded Modules in the apache section make sure mod_rewrite is listed.
#4

[eluser]brianw1975[/eluser]
check that you have AllowOverride All in your host config file for the public web directory
#5

[eluser]Ludatha[/eluser]
Mike L: That made my homepage load but none of the links...

This is my phpinfo, mod_rewrite is loaded because I have used it for many other things.
http://ludatha.com/info.php
#6

[eluser]nzmike[/eluser]
I'm not sure what's wrong with your set-up but you probably shouldn't allow people to view you phpinfo page. It makes it very easy for a hacker to find the security holes on your server.
#7

[eluser]Ludatha[/eluser]
I just found out that 'The AllowOverride directive in the Apache's configuration has been set to ‘All’ on all servers.'
#8

[eluser]Mike L[/eluser]
[quote author="Ludatha" date="1252247403"]Mike L: That made my homepage load but none of the links...

This is my phpinfo, mod_rewrite is loaded because I have used it for many other things.
http://ludatha.com/info.php[/quote]

Oh, I forgot to tell you a step :lol:

In your config file

system/application/config/config.php

Change this line.

Code:
$config['index_page'] = "index.php";

To this

Code:
$config['index_page'] = "";
#9

[eluser]derekmichaeljohnson[/eluser]
[quote author="Ludatha" date="1252247403"]That made my homepage load but none of the links...[/quote]
Whenever I have a CI app on someone else's server and this happens, I adjust the following line in the config.php file:
Code:
$config['uri_protocol']    = "AUTO";
Try changing it to:
Code:
$config['uri_protocol']    = "REQUEST_URI";
#10

[eluser]Ludatha[/eluser]
Thanks, I tried all your ideas but the homepage loads but the links still need index.php in them to work...




Theme © iAndrew 2016 - Forum software by © MyBB