[eluser]Marc Arbour[/eluser]
Hello to all.
I did manage to remove the index.php from my URLs with mod_rewrite.
Here's my .htaccess file:
Code:
RewriteEngine on
# remove dangling index.php in request uri (hint: google, duplicated content)
RewriteRule ^index.php$ / [L,R]
# redirect requests going to www.domain.com to only domain.com
RewriteCond %{HTTP_HOST} ^www.(.+) [NC]
RewriteRule ^(.*)$ http://%1/$1 [L,R,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# I have two additional directories in website structure,
# both of which hold stuff not directly related to kohana (images, raw html templates, css, js...)
# and sometimes I want to enable directory browsing in them.
RewriteCond $1 !^static
RewriteCond $1 !^html
RewriteCond $1 !^index.php [OR]
RewriteRule ^(.*)$ index.php/$1 [L]
Now, Here's the situation: I have a controller/function/parameter/parameter that always looks like
Code:
domain.com/banners/view/1/administrateur
#note the www is removed as well as the index.php
That I'd like to see stripped of it's controller/function part like
Code:
domain.com/1/administrateur
Leaving all other modules/functions work without changes. Even leaving other functions in the banners module as they are now.
I know I can remove part of a URI... Did it with index.php. But can this be done for only 1 module AND 1 function as well? Is there anyone knowledgeable enough with mod_rewrite that can point me in the right direction?
Any pointers will help.
Thanks and best regards.
Marc