Closed Thread Icon

Topic awaiting preservation: Forking synonym domains with .htaccess (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=29842" title="Pages that link to Topic awaiting preservation: Forking synonym domains with .htaccess (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Forking synonym domains with .htaccess <span class="small">(Page 1 of 1)</span>\

 
argo navis
Bipolar (III) Inmate

From: Switzerland
Insane since: Jul 2007

posted posted 01-05-2008 16:01

'lo.

I just got myself a new domain name, www.mauro-colella.com (it may take up to 24 hours to be available to everybody).
Synonym to www.beyondwonderland.com.

I don't want both sites to display the same thing, but I want them to be under the same web root.

So, I whacked that with .htaccess (try to spot a potential bug) :

code:
Options +FollowSymLinks -Indexes 
RewriteEngine On
# Rewrite rule for mauro-colella.com 
RewriteCond %{HTTP_HOST} ^www\.mauro-colella\.com 
RewriteRule $(.*)^ http://www.mauro-colella.com/gateway/$1 [L]



Basically, depending on which domain name you use to access the very same site, you will be redirected to "gateway",
where the professional side of my activities will reside.

hyperbole
Paranoid (IV) Inmate

From: Madison, Indiana
Insane since: Aug 2000

posted posted 01-05-2008 19:23

You've created an infinite loop in your rewrite rule. I think what you should do is

code:
Options +FollowSymLinks -Indexes 
RewriteEngine On
# Rewrite rule for mauro-colella.com 
RewriteCond %{HTTP_HOST} ^(www\.)?mauro-colella\.com 
RewriteRule (www.)?mauro-colella.com/(.*) http://www.beyondwonderland.com/gateway/$2 [L]



Off the top of my head, so this may be wrong.

.



-- not necessarily stoned... just beautiful.

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

posted posted 01-05-2008 19:30

You can use something like this, too, AFAIK:

code:
RewriteCond %{REQUEST_URI} !gateway

argo navis
Bipolar (III) Inmate

From: Switzerland
Insane since: Jul 2007

posted posted 01-05-2008 19:34

hypabole, chill There's no infinite loop there : it works - http://www.mauro-colella.com
does NOT display the White Rabbit, it displays the correct target folder.

It would be infinite if it was:

quote:

RewriteRule (.*) /gateway/$1 [L]



Off the reality of my web server Thank you for the input though, I was merely sharing - there is one possible improvement, though : sub domains (eg. no www, * instead).

« BackwardsOnwards »

Show Forum Drop Down Menu