Welcome Guest, Not a member yet? Register   Sign In
codeigniter broken link
#1

[eluser]schiller[/eluser]
I'm new in codeigniter. i have a project running perfectly in my localhost. when i deployed, my links seem to be broken. e.g. mysite.com displays the homepage without any error. now, i have a link let's say an about us link e.g. mysite.com/main/about where main is my controller and about is my function. the problem is the about us link is broken e.g. "Oops! This link appears to be broken." i am also sure that i uploaded the htaccess. do you have any idea where did i go wrong? thank you for any positive response.
#2

[eluser]Clooner[/eluser]
So, you correctly have uploaded the .htaccess file to rewrite the urls? You also correctly enabled mod_rewrite in apache? What do the log files say?
#3

[eluser]schiller[/eluser]
well now here it goes, i removed the htaccess and went back to the default configuration. the url mysite.com/index.php/main/about supposedly must work now but still it gives the same error. isn't it should be correct already and no errors anymore?
#4

[eluser]vitoco[/eluser]
did you change the $config['base_url'] in the config file to fit the production server ??
#5

[eluser]Clooner[/eluser]
What kind of errors are you getting? CI errors or webserver errors? Again what does the log file say?
#6

[eluser]schiller[/eluser]
hey clooner got it! its one of the snags of godaddy. instead of mysite.com/index.php/main/about it should be mysite.com/index.php?main/about and it went fine. now my problem is how to make it a pretty url. thanks clooner and i really appreciate spending some time Smile
#7

[eluser]vitoco[/eluser]
i think the only thing you must change is the "/" to a "?" in the .htacces file
Code:
RewriteRule ^(.*)$ index.php/$1 [L] // OLD
RewriteRule ^(.*)$ index.php?$1 [L] // NEW

maybe scape the '?' cause it has a meaning in the regex
#8

[eluser]schiller[/eluser]
hi vitoco that seems a good idea. i will update you if it worked fine but i suspect it might really work.
#9

[eluser]mobilizedesign[/eluser]
[quote author="schiller" date="1274913401"]hey clooner got it! its one of the snags of godaddy. instead of mysite.com/index.php/main/about it should be mysite.com/index.php?main/about and it went fine. now my problem is how to make it a pretty url. thanks clooner and i really appreciate spending some time Smile[/quote]

are you talking about making this change in the .htaccess file? or the config.php file?

thx




Theme © iAndrew 2016 - Forum software by © MyBB