Google Answers Logo
View Question
 
Q: complicated htacess issue - RewriteRule ( No Answer,   3 Comments )
Question  
Subject: complicated htacess issue - RewriteRule
Category: Computers > Programming
Asked by: samodio-ga
List Price: $10.00
Posted: 11 Nov 2006 17:36 PST
Expires: 11 Dec 2006 17:36 PST
Question ID: 781966
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 change it to the following:
http://foobar.domain.com/test redirects to
http://domain.com/index.php?title=foobar:test&useskin=bluwiki_skin
Answer  
There is no answer at this time.

Comments  
Subject: Re: complicated htacess issue - RewriteRule
From: crxvfr-ga on 15 Nov 2006 08:15 PST
 
I don't know how much you know about mod rewrite or htaccess files,
but here is a htaccess generator that has lots of options.

http://cooletips.de/htaccess/
Subject: Re: complicated htacess issue - RewriteRule
From: crxvfr-ga on 15 Nov 2006 08:26 PST
 
You might also consider a php 301 redirect. This method does not
require you to change your htaccess file. You simply replace the
existing page (usually by renaming it so you retain the original) with
a simple php file. The php file is given the same name as the page you
want to redirect, the original that you just renamed. A 301 redirect
file is as simple as this:

<?php
header( 'Location: http://www.yoursite.com/new_page.html' ) ;
?>

Just replace the address to the page you want to redirect to.

More info 301 redirects can be found lots of places on the web. If you
have questions I would suggest going to an SEO (search engine
optimization) forum to investigate. These forums offer a wealth of
information on a wide variety of issues that will help you make your
site more visible.
Subject: Re: complicated htacess issue - RewriteRule
From: calcop-ga on 18 Nov 2006 03:31 PST
 
This is what you want after the RewriteCond:

RewriteRule ^(.*)$ http://domain.com/index.php?title=%1:$1&useskin=bluwiki_skin

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