CodeIgniter Forums
Mod ReWrite help... - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Mod ReWrite help... (/showthread.php?tid=56821)



Mod ReWrite help... - El Forum - 01-22-2013

[eluser]Unknown[/eluser]
I'm having trouble figuring out how to write my rewrite.

My ultimate goal is:
http://www.domain.com/$USERSITE/$PAGE


My goal for now is:
http://www.domain.com/site/$USERSITE/$PAGE

So on my site controller I have

Code:
function index($usersite, $page)

I have the index.php gone with the below ReWrite.

Code:
RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

When I go to /site it works but when I have that $usersite and $page param on the URL it gives me an internal error 500.

Any advice on the rewrite?

Thanks.