Welcome Guest, Not a member yet? Register   Sign In
friendly URL's and .htaccess
#4

[eluser]Tazz[/eluser]
Oh wow, I have spent about roughly 8 hours trying to figure out how to call pages using hrefs and managaging to use friendly URL's.

What I did to get it working :

system\application\config\config.php :

$config['uri_protocol'] = "REQUEST_URI";

My .htaccess file :

DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L,QSA]

And when I call a view :
function index()
{
$this->load->view('header');
$data = array(
'title' => 'My Title',
'heading' => 'heading',
'message' => 'My Message',
'base_url' => $this->config->item('base_url'));

$this->load->view('navigation', $data);
$this->load->view('uses', $data);
$this->load->view('footer');
}

My link on the view to another page :

<a href='".$base_url."mylinks'>Links</a>

And it actually works on my hosting server!!!!


Messages In This Thread
friendly URL's and .htaccess - by El Forum - 10-04-2008, 12:55 AM
friendly URL's and .htaccess - by El Forum - 10-04-2008, 02:24 AM
friendly URL's and .htaccess - by El Forum - 10-04-2008, 02:49 AM
friendly URL's and .htaccess - by El Forum - 10-04-2008, 03:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB