weird issue with a controller |
[eluser]jblack199[/eluser]
I've got a site that I built, and i've put it on 2 different domains... The first domain works fine... The second domain is having issues.... Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); This is an example of my controller.... so when I go to: http://www.domain.org it pulls up the index perfectly... however when i go to http://www.domain.org/welcome/newProspect it still only pulls up the index() function instead... but when i go to http://www.domain.org/index.php/welcome/newProspect it works.. even though I have htaccess in place to remove the index.php from the URL.. which looks like: Code: <IfModule mod_rewrite.c> any ideas?
[eluser]vbsaltydog[/eluser]
Are both sites on the same server? If not, does the non-working server have mod_rewrite enabled in Apache?
[eluser]CroNiX[/eluser]
Not having to do with your problem, but those lines pertaining to the system and application directories in your htaccess are not needed. Those directories come stock with their own htaccess now.
[eluser]jblack199[/eluser]
@vbsaltydog, no both are not on the same server.... I've written a quick test script to see if mod_rewrite is enabled in the system and mod_rewrite is definitely enabled in Apache. Although I figured out what's going on i just have no clue how to fix it.... I uploaded a FRESH codeigniter installation into /test/ on the server... http://domain.org/test/welcome/testing so /test is the base path... /welcome is the controller /testing is the secondary function inside that controller So when I create: Code: public function testing() { and delete the index() function and go to http://www.domain.org/test/welcome/testing/ it gives me a 404 instead of what i'm expecting to see... SO it's seeing the controller just fine, but it's NOT seeing anything past the controller in the URL...
[eluser]vbsaltydog[/eluser]
Try this: Code: public function testing() {
[eluser]jblack199[/eluser]
Whats happening is its not even reading the testing() function at all... I did figure it out though perhaps you can shed some light into why this might be the case... on the working server i have in my .htaccess like Code: RewriteRule ^(.*)$ index.php/$1 [L] but on this server that doesn't work so I changed it to: Code: RewriteRule ^(.*)$ index.php?$1 [L] and it works just fine... |
Welcome Guest, Not a member yet? Register Sign In |