Remove /auth/ from url?

Hey there

I'm using the lovely DX_Auth in my app to look after login etc

It's working really well ... and it's a great bit of code.

I want to tailor my app though ... DX_Auth uses two url slugs to drive sections of it.

index.php/auth/login/ or index.php/auth/register/

and for backend stufff (by default) it's

Of course I've changed the /backend/ bit to something less well known for my admin stuff ...

But I want to dump the /auth/ altogether for the users

Of course I have .htaccess for ripping out the index.php - but my .htaccess skills are ... well... crap

I basically want to have ... point to

I want to then be able to do ... and use the username variable out of the url .. just like twitter's etc


I did try this:
<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} ^system.*
    RewriteRule ^(.*)$ /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
    #specific rules now
    RewriteRule ^/login/(.*)$ index.php/auth/login/$1 [L]
    RewriteRule ^(.*)$ index.php?/$1 [L]

URI Routing to the rescue

Yeah I've been looking at that .. I realised you posted that answer on a similar question - I was going to pull mine but ....I'm really struggling to get routing sorted out ...

Do you simply say

$route['url/expected'] = anything/I/want/here; - well within reason?

So I could do ...

$route['/login/'] = "/auth/login/";

I must be doing something else wrong if that's the case .. hmmm

I normally don't have forward slashes at the start/end, that might be causing you some problems

YES!! ... got it sorted Smile

and I do love the power of these routes ... oh man I'm having fun with them now - THANK YOU!!

yea - it was the / that was causing the issue

I'd assume it cause if you start a route with a forwrd slash, it looks for an absolute path, whereas you want yours to all be relative Smile

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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