Find us elsewhere
Join Now Member Login

.htaccess misery

 
New Topic
Post Reply
Follow Topic
Page of 1
  • Author
  • Message
 
ThreeDify

posts: 2

Apr 15, 2010 3:01 PM ET    Quote  Report Abuse
Points: 0   Vote

I am trying to set up canonical redirects in my .htaccess file in order to manage my domains.  The situation is complicated by the fact that there is already a set of rewrite rules in place for the CMS, (Joomla).  My approach was to not mark the canonical redirects as final, and to place them before the SEF rewite rule block for Joomla.

I added this block of instructions:

######### create canonical domains ##################

RewriteCond %{HTTP_HOST} ^3dify.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.3dify.com$ [OR]
RewriteCond %{HTTP_HOST} ^threedify.com$
RewriteRule ^/?(.*) "http://www.threedify.com/$1" [R=301,NC]

The result sort of works, in that a request for pages at 3dify.com, threedify.com, or www.3dify.com will always return http://www.threedify.com/index.php.  The problem is that the rest of the URL is ignored instead of being appended to the new domain, so any request for a page at a non-canonical domain ALWAYS redirects to the site index.

This isn't what I want.  I would like to return the requested page, not redirect to the site root.  Why is the $1 getting chomped?  Does anyone have any ideas for me?

Thanks very much,

Chris Ivey, Marketing Director, ThreeDify

ThreeDify

posts: 2

Apr 19, 2010 3:36 PM ET    Quote  Report Abuse
Points: 0   Vote

For crying out loud.  Solved the problem myself.  I DID have to mark that block as final.  Fixed by adding an "L" flag to the rewrite rule.

Page of 1
Post Reply
 
.
Advertisement

Keep the Community Clean!

  • StartupNation forums should be used as a platform to learn, educate others, share stories, tips & tricks and to provide constructive feedback.
  • Please do not use the Forums for advertising & blatant self-promotion.
  • Please be respectful to other members and refrain from personal attacks and vulgar language.
  • StartupNation reserves the right to delete any message, reply, and/or member who violates our terms of use.
Read full terms of use
Advertisement
Advertisement
Advertisement
Advertisement