Linode Forum Index Linode Forum
Linode Community Forums
 


htaccess redirect question

Click here to go to the original topic

 
       Linode Forum Index -> General Discussion
Author Message
alforddm



Joined: 05 Jul 2011
Posts: 19
Location: http://colorgenetics.info

Posted: Fri Jan 20, 2012 10:41 am    Post subject: htaccess redirect question  

I need to rewrite part of a path. For example my I need to go from

site/canine/gallery/v/restofpath

to site/gallery/v/canine/restofpath

Does anyone have any suggestions for this? I've tried doing simple folder rewrites and that doesn't seem to do the trick.

Thank you
Back to top  
hoopycat



Joined: 30 Aug 2008
Posts: 1294
Location: Rochester, New York

Posted: Fri Jan 20, 2012 5:54 pm    Post subject:  

Which web server are you using? What have you tried that didn't work?
Back to top  
alforddm



Joined: 05 Jul 2011
Posts: 19
Location: http://colorgenetics.info

Posted: Fri Jan 20, 2012 7:58 pm    Post subject:  

It's apache 2 with mod_rewrite.

This is what I've tried so far.


RewriteCond %{HTTP_HOST} ^/canine/gallery/v/$ [NC]
RewriteRule ^(.*)$ http://colorgenetics.info/gallery/v/canine/$1 [R=301,L]


RewriteRule ^canine/gallery/v/(.*)$ gallery/v/canine/$1 [R=301,NC,L]

RewriteRule ^canine/gallery/v/$ gallery/v/canine/$1 [R=301,NC,L]

Redirect permanent /canine/gallery/v/ http://colorgenetics.info/gallery/v/canine/


RewriteRule ^canine/gallery/v/(.*) /gallery/v/canine/$1 [L,R=301]
trys to work redirects to http://colorgenetics.info/gallery/v/canine/?q=canine/gallery/v/ where i get a drupal page not found error



RewriteRule ^canine/gallery/v/ /gallery/v/canine/$1 [L,R=301]
Works to redirect just the line canine/gallery/v/ but anything of the form canine/gallery/v/restofurl gives a generic link broken server reply
Back to top  
 
       Linode Forum Index -> General Discussion
Page 1 of 1