[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