Changing the URI core class ~ I've done something bad ! |
[eluser]sikko[/eluser]
Hi all, The URI class uses the variable $_SERVER['SCRIPT_NAME'] to remove '/index.php' from the $_SERVER['REQUEST_URI'], and return the class/method name to codeigniter. I'm using url rewriting and this .htaccess file to remove index.php from the url. My problem: - on my localhost: $_SERVER[SCRIPT_NAME] = '/index.php' - online: $_SERVER[SCRIPT_NAME] = '/controller_name/method_name' So when i'm online, the _detect_uri() method of URI class returns '', and all pages return the default controller... Weird insn't ? The only solution I found for my website to work as it does in local is to hardcode '/index.php' in the URI class and replace all occurences of $_SERVER['SCRIPT_NAME'] with 'index.php' Bad and Dirty... I know... Is it a CodeIgniter bug ?
[eluser]InsiteFX[/eluser]
See _remap in the CodeIgniter User Guide! And next time extend the URI Class do not hack it! InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |