Could you please help me to write .htaccess rewrite rule that will rewrite one string in URL to another (in this case user -> profile):
eg: http://my.site.com/index.php/user/194/
It should be like this to work
eg: http://my.site.com/index.php/profile/194/
It should also change all “user” words to “profile”, not just the first.
I have tried with the following code but it is not working for some reason:
RewriteCond %{QUERY_STRING} ^user=([^&]*) [NC]
RewriteRule ^ %{REQUEST_URI}?profile=%1 [R=301,L]
Please assist. Thank you all in advance.
You should be using CodeIgniter’s built in routes for this:
http://codeigniter.com/user_guide/general/routing.html