Welcome Guest, Not a member yet? Register   Sign In
cannot get route to work with "+" character in it.
#1

[eluser]otherjohn[/eluser]
Hi all,
I am trying to get a route for my site where the page would be
http://www.doctyped.net/designs-to-html/...words+here
but I get a 404.

in my routes I have
Code:
$route['design-to-html/([a-z]+)']="basecontroller/landing/$1";

and in my basecontroller file I have
Code:
function landing()
    {
        $page = array();
        $data = array();
        $data['title'] = "Convert PSD to xHTML - doctyped.net";
        $data['description'] = "Doctyped.net converts your designs to valid xhtml and templates for CMS software like wordpress, joomla, blogger, cubecart, and more.";
        $data['keywords'] = "";
        $data['head'] = "";
        $page = array();
        
        
        
        $page['contentLF'] = $this->load->view('homecontent_view',$data,true);
        $page['contentRT'] = $this->load->view('baseside_view',$data,true);
        $this->load->view('base_template', $page, false);
    }
I also have this in my config so that I can use the "+"
Code:
$config['permitted_uri_chars'] = '\+a-z 0-9~%.:_-';
But I do not understand why its giving me a 404
#2

[eluser]Sam Dark[/eluser]
You need to include + into your route:
Code:
$route['design-to-html/([a-z+]+)']="basecontroller/landing/$1";
#3

[eluser]otherjohn[/eluser]
thanks, that was it.




Theme © iAndrew 2016 - Forum software by © MyBB