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

[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!

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

# 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 !mod_rewrite.c>
# If mod_rewrite isn\'t enabled try and
# forward request to index.php

ErrorDocument 404 index.php


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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