Problem with url helper functions, SOMETIMES |
[eluser]CroNiX[/eluser]
Im not sure whats going on but on some pages when I use url helpers like base_url(), site_url() and anchor() they don't seem to work properly on some pages. in config.php: Code: config['base_url'] = 'http://www.mysite.com/appname/'; If I do Code: echo anchor('controller/method'); It works on some pages, but not others, so Im kind of confused. Heres the .htaccess from www.mysite.com/appname RewriteEngine On # Handle the index.php file RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] I had to add the ? after index.php to get it working on the live server. Any help would be appreciated. Thanks!
[eluser]TheFuzzy0ne[/eluser]
First of all, try clearing your cache. Secondly, I'd suggest a: Code: RewriteBase /appname/ As if I understand correctly, the rewrite rule is rewriting the rule according to the web root, not the subdirectory. I'm probably wrong though.
[eluser]Thiago Luiz[/eluser]
I'm not sure if this is correctly but into .htaccess try do put the name of your controller in a RewriteRule to the request be redirect to the index.php of your aplicattion. Look like this: RewriteEngine on RewriteCond $1 !^(index\.php|images|stylesheet|javascript|robots\.txt|css|pdf) RewriteRule ^(ControllerNameOne.*)$ /CodeIgniter/index.php/$1 [NC] RewriteRule ^(ControllerNameTwo.*)$ /CodeIgniter/index.php/$1 [NC] |
Welcome Guest, Not a member yet? Register Sign In |