• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URL Manipulation

So is it possible for me to make a url that looks like this:

look like this:

If so, how do I go about that?

Thank you.

[eluser]Glen Swinfield[/eluser]
First you need to use .htaccess to remove the index.php then config/routes.php to deal with the routing of the page - something like this:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteCond $1 !^(index\.php|images|css|robots\.txt|favicon\.ico)
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
    RewriteRule /favicon\.ico /images/favicon.ico [L]

    SetEnv mod_rewrite_enabled 1

<IfModule !mod_rewrite.c>
    SetEnv mod_rewrite_enabled 0

$route[':any'] = "admin/view";

Put any routes after the default ones - And I'm not sure if this will work anyway - you may have to use
$route['view/:any'] = "admin/view";

and have the url http://www.site.com/view/entryname

Check the user manual for routing.

Ah. That's so close to working! I do have to write it like "view/:any", though. Unfortunately I need it to appear like it's at the root level - not in a "view" folder.

Any other suggestions on this?

[eluser]Glen Swinfield[/eluser]
Sorry - I'm all out on this one. >Sad

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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