CodeIgniter Forums
anchor function is getting redirected to home page always irrespective of url - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: anchor function is getting redirected to home page always irrespective of url (/showthread.php?tid=42199)



anchor function is getting redirected to home page always irrespective of url - El Forum - 05-30-2011

[eluser]Unknown[/eluser]
hello,
i have used anchor function in my header.php file to set url's for tabs.
Default controller is set in routes.php file as
$route['default_controller'] = "web/master";

the code used for anchor function is like
<?php echo anchor('blog', 'BLOG'); ?>

The extension added is .html which is set in config.php as
$config['url_suffix'] = ".html";

On clicking on tab the address bar shows the url as http://localhost:83/myapplication/blog.html but the page it shows is http://localhost:83/myapplication/index.php

So i am unsure about what is going wrong with it.
Can anybody please help me out with this?
Thanks in advance...


anchor function is getting redirected to home page always irrespective of url - El Forum - 06-01-2011

[eluser]ProImage Web[/eluser]
have you tried:
Code:
<?= anchor(base_url().'blog', 'BLOG'); ?>


OR

make sure rewrite is on and working and that your .htaccess file is formatted correctly.. Just recommending the obvious culprits first.