routing question

I think that would be easiest

i guess my question do i exclude 'main' from being redirected?

im beginning to question where i shouldve put the CodeIgniter folder. I put as a folder at my root next to my index.php frontpage. Should i have just put the System folder found within the CodeIgniter there instead? I say this because all of my urls have the CodeIgniter folder in them like below

You'll have to use regular expressions
$route['(^[^(main)])'] = "controller/function/$1";

I don't think that works, I'm not very good at regular expressions

As for the codeigniter folder question, you can get around that with an .htaccess file
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^codeigniter/system.*
    RewriteRule ^(.*)$ /codeigniter/index.php?/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /codeigniter/index.php?/$1 [L]

This says, if the request is not a valid file or folder, send it to /codeigniter/index.php

Then, instead of you can do

I think you need to do far more complex routing than that. I think you would need to overide the default index routing using remap then pass the paramter through a method created in a model or otherwise to check if a user exists then if not check for other methods that could exist (for standard page routing).

I have done something before outside of codeigniter that does this whereby we mod rewrite to index and first parse the routing against pages in the system before passing it to a data call to check for a saved custom page.

It would be far easier to create a controller one level down so but to get what you want and still make a site that can show other pages than profiles you need to do some reworking of the routing. I don't think solely using any to parse a username is good enough.

so i add that to my .htaccess file found in my root folder?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.