Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6529945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:41:50+00:00 2026-05-25T09:41:50+00:00

I use Codeigniter’s _remap function to remap all urls to www.website.com. This works for

  • 0

I use Codeigniter’s _remap function to remap all urls to http://www.website.com. This works for 99% of cases, but I’d like it to ignore certain URLS (specifically /admin,/contact,/submit,/top,/browse). These URLs have content I’d like to display.

How would I achieve this?

public function _remap($urlname)
{
    if($urlname == "index") {
        // If this is the index, redirect to the most recent startup
        redirect("s/".$this->Startup_model->getMostRecent(), 'refresh');
    } else {
        // If they didn't go to the index, find the startup they were after
        $id = $this->Startup_model->matchName($urlname);

        // Check to see if the name they entered was a real startup, if not redirect to missing page
        if($id == null) {
            $data['urlname'] = $urlname;
            $this->load->view('header/header');
            $this->load->view('content/missing', $data);
            $this->load->view('footer/footer');
        } else {
            // They got the name right!  Load the page...
            $data['values'] = $this->Startup_model->buildStartup($id);

            // If there was no next startup avaiable, pass that info through
            $next = $this->Startup_model->findNext($id);
            if($next == null) {
                $next = '343z61v';
            }

            // If there was no previous startup avaiable, pass that info through
            $previous = $this->Startup_model->findPrevious($id);
            if($previous == null) {
                $previous = '343z61v';
            }

            $data['next'] = $next;  
            $data['previous'] = $previous;

            $this->load->view('header/header');
            $this->load->view('content/startup', $data);
            $this->load->view('footer/footer');
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:41:50+00:00Added an answer on May 25, 2026 at 9:41 am

    Try this:

    function _remap($urlname, $params = array())
    {
        if(is_callable(array($this, $urlname))){ //If the function exists, is called, if not using the usual
            return call_user_func_array(array(&$this, $urlname), $params);
        }elseif($urlname == "index") {
                // If this is the index, redirect to the most recent startup
                redirect("s/".$this->Startup_model->getMostRecent(), 'refresh');
        } else {
            // If they didn't go to the index, find the startup they were after
            $id = $this->Startup_model->matchName($urlname);
    
            // Check to see if the name they entered was a real startup, if not redirect to missing page
            if($id == null) {
                $data['urlname'] = $urlname;
                $this->load->view('header/header');
                $this->load->view('content/missing', $data);
                $this->load->view('footer/footer');
            } else {
                // They got the name right!  Load the page...
                $data['values'] = $this->Startup_model->buildStartup($id);
    
                // If there was no next startup avaiable, pass that info through
                $next = $this->Startup_model->findNext($id);
                if($next == null) {
                    $next = '343z61v';
                }
    
                // If there was no previous startup avaiable, pass that info through
                $previous = $this->Startup_model->findPrevious($id);
                if($previous == null) {
                    $previous = '343z61v';
                }
    
                $data['next'] = $next;  
                $data['previous'] = $previous;
    
                $this->load->view('header/header');
                $this->load->view('content/startup', $data);
                $this->load->view('footer/footer');
            }
        }
    }
    

    Note:
    Function index() should not exist

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use Codeigniter to create a multilingual website and everything works fine, but when
I'm using this plugin: http://jqueryui.com/demos/autocomplete/#remote Works great but I would like to use the
I am trying to learn CodeIgniter to use for a shopping site, but I
I would use CodeIgniter in my new project, but i only use the helper
In codeigniter we use a method call like this $this->load->view(); I wanna know what's
I'm trying to use SimplePie with Codeigniter but I can't get even the view
I use CodeIgniter and i love it, but i don't know whether it's really
How do I use the require_once php function in Codeigniter on a normal PHP
I'm trying to send an e-mail with Codeigniter like this: $this->load->library('email'); $this->email->from(myemail@email.com); $this->email->reply_to(myemail@email.com); $this->email->to(myemail@email.com);
I use CodeIgniter and let's say i build a blog where /posts shows all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.