Welcome Guest, Not a member yet? Register   Sign In
HTACCESS - A Complex Problem
#1

[eluser]vanquish[/eluser]
Hello all,

I have been have some big struggles trying to exclude a particular URL from being rewritten by CodeIgniter.

The Situation:
I have almost all URL requests being routed through my "pages" controller, which looks up the URL segment in the database and returns a page if a match exists.

The Exception:
However, there are certain sections of the site that I do *not* want pushed through the pages router.

For example, my authentication controllers have to be separate from the pages.

Using the .htaccess file listed below, I cannot for the life of me figure out an exception for the auth controller.

I want to rewrite:
/auth -> index.php/auth/login (erroneously tries to reach index.php/pages/load_page/auth/login - causes 404!)
/auth -> index.php/auth/register (erroneously tries to reach index.php/pages/load_page/auth/register - causes 404!)

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    #Removes access to the system folder by users.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php$1 [L]

    #Is the user accessing a valid file?
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    #Enables access to the images and css folders, etc
    RewriteCond $1 !^(index\.php|images|robots\.txt|css)
    #Rewrite the URL to the pages router
    RewriteRule ^(.*)$ index.php/pages/load_page/$1 [L]
    
</IfModule>

<IfModule !mod_rewrite.c>
    # Send to 404 if we don't have mod_rewrite
    ErrorDocument 404 /index.php
</IfModule>

If anyone has any insights, it would be greatly appreciated Smile


Messages In This Thread
HTACCESS - A Complex Problem - by El Forum - 07-21-2010, 05:00 AM
HTACCESS - A Complex Problem - by El Forum - 07-21-2010, 06:30 AM
HTACCESS - A Complex Problem - by El Forum - 07-21-2010, 07:07 AM
HTACCESS - A Complex Problem - by El Forum - 07-22-2010, 03:40 PM
HTACCESS - A Complex Problem - by El Forum - 07-23-2010, 12:49 AM
HTACCESS - A Complex Problem - by El Forum - 07-23-2010, 08:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB