Welcome Guest, Not a member yet? Register   Sign In
Using Mod_Rewrite and _Remap in 2.x
#1

[eluser]Lakestone[/eluser]
I have an old CI application that I'm trying to port to the latest version.
All I want to is to take in the first segment of the welcome page and then remap:

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Start extends CI_Controller
{
public function _remap($uri)
{
  if($uri == 'contact')
   $this->contact();
}
public function contact()
{
  $this->load->view('contact');
}
public function index()
{
}
}

Since 'Start' is my main controller, the url will look like "localhost/app1/". And if I type into the address bar "localhost/app1/contact" it should use the main controller but call the contact function.

Can I accomplish this without using mod rewrite? If not, this is the current .htaccess code that I use:
Code:
RewriteEngine On
RewriteBase //
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/Start/$1 [L]

What else is missing? I keep getting "Not Found - The requested URL /index.php/Start/contact was not found on this server."

Cheers


Messages In This Thread
Using Mod_Rewrite and _Remap in 2.x - by El Forum - 03-05-2012, 07:43 AM
Using Mod_Rewrite and _Remap in 2.x - by El Forum - 03-05-2012, 06:33 PM
Using Mod_Rewrite and _Remap in 2.x - by El Forum - 03-06-2012, 06:24 AM
Using Mod_Rewrite and _Remap in 2.x - by El Forum - 03-06-2012, 04:19 PM
Using Mod_Rewrite and _Remap in 2.x - by El Forum - 03-06-2012, 05:19 PM
Using Mod_Rewrite and _Remap in 2.x - by El Forum - 03-06-2012, 06:14 PM
Using Mod_Rewrite and _Remap in 2.x - by El Forum - 03-07-2012, 04:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB