Google Answers Logo
View Question
 
Q: complicated htacess issue - RewriteRule ( No Answer,   0 Comments )
Question  
Subject: complicated htacess issue - RewriteRule
Category: Computers > Programming
Asked by: odioworks_com-ga
List Price: $15.00
Posted: 29 Nov 2006 09:45 PST
Expires: 29 Dec 2006 09:45 PST
Question ID: 786617
Currently I have my .htaccess file set up to redirect subdomains as follows:

http://foobar.domain.com redirects to
http://domain.com/index.php?title=foobar&useskin=bluwiki_skin

These are the rules to accomplish that:
Code:
RewriteCond %{HTTP_HOST} ^([^.]+)\.bluwiki\.com
RewriteRule (.*) /index.php?title=%1&useskin=bluwiki_skin [L]


I would like to add the following rule:
http://foobar.domain.com/test redirects to
http://domain.com/index.php?title=foobar:test&useskin=bluwiki_skin

while still maintaining the original redirect:
http://foobar.domain.com/ redirects to
http://domain.com/index.php?title=foobar&useskin=bluwiki_skin

Clarification of Question by odioworks_com-ga on 29 Nov 2006 10:46 PST
This is the closest thing I can come up with:

RewriteCond %{HTTP_HOST} ^([^.]+)\.bluwiki\.com
RewriteRule ^page/(.*)$ /index.php?title=%1/$1&useskin=bluwiki_skin [L]

RewriteCond %{HTTP_HOST} ^([^.]+)\.bluwiki\.com
RewriteRule ^(.*)$ /index.php?title=%1&useskin=bluwiki_skin [L]

In this case the first rule only executes on URLs like
http://foobar.bluwiki.com/page/test and the second rule executes on
sites like http://foobar.bluwiki.com/

Ideally, I would like the first redirect to execute on any URL that
has something trailing the domain name (i.e.
http://foobar.bluwiki.com/test) and the second rule would execute when
there's nothing trailing the domain name (i.e.
http://foobar.bluwiki.com/)

Clarification of Question by odioworks_com-ga on 29 Nov 2006 10:52 PST
Note, this is a continuation of the question asked here:
http://google.com/answers/threadview?id=781966, with the only
difference being that the original redirect is maintained, instead of
replaced.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy