• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need help with a mod_rewrite :)

#1
[eluser]the real rlee[/eluser]
Hi I\'m using the stock CI mod rewrite to get rid of the \"index.php\" at the start of my URI\'s, but i\'d like to extend this rewrite to make the server redirect any request bar user/... main/.. to a specific controller function. The situation is my main website has a number of subsites which look like www.mysite.com.au/joebloggs which needs to be passed to my Sites controller i.e. www.mysite.com.au/joebloggs - > Sites/index/joebloggs.

Your help greatly appreciated!

Code:
# CI needs PATH_INFO
<Files \"index.php\">
AcceptPathInfo On
</Files>

# Check mod_rewrite is enabled
<IfModule mod_rewrite.c>
# Lets remove index.php from URI...
RewriteEngine On\nRewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# If mod_rewrite isn\'t enabled try and
# forward request to index.php

ErrorDocument 404 index.php

</IfModule>
"


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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