Need help with htaccess and Redirection issue

micks80

Joined: 2012-04-22
Posts: 71
Posted: Fri, 2013-04-26 03:54

Hi Friends,
We need some help with htaccess and redirection. We use to have a "Photo-Shoots" folder which we have deleted and want to redirect all references to it, so we added the following code in .htaccess

   RedirectMatch 301 ^/gallery/index.php/Photo-Shoots/(.*)$  /gallery/$1
   RedirectMatch 301 ^/gallery/Photo-Shoots/(.*)$ /gallery/$1 

   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
 
   RewriteRule ^(.*)$ /gallery/index.php?kohana_uri=$1 [QSA,PT,L]
   RewriteRule ^$ /gallery/index.php?kohana_uri=$1 [QSA,PT,L]
   RewriteRule ^/gallery/index.php/(.*) $1 [QSA,R,L]

Surprisingly, the first one (/gallery/index.php/Photo-Shoots/...) works but the second doesn't (/gallery/Photo-Shoots/...). The second link redirects the site to this:

http://mysite.com/gallery/Album-Name?kohana_uri=Photo-Shoots/Album-Name

Can someone please help us to fix this issue?

Thanks a lot,
Mick