Redirect Loop

Using a single web hosting account to host multiple sites

Redirect Loop

Postby jboesch » Tue Jul 31, 2007 6:37 am

This is what I have right now. I would like all subdomains (sub.utrack.org) to be redirected to http://sub.utrack.org/accounts, but its looping cause there is still a subdomain in the URL. How can I say as a RewriteCond if the "/accounts" exists.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.utrack\.org
RewriteCond %{HTTP_HOST} ([^.]+)\.utrack\.org [NC]
RewriteRule ^(.*)$ http://%1.utrack.org/accounts/ [R,L]
jboesch
 
Posts: 2
Joined: Tue Jul 31, 2007 6:34 am

Postby jboesch » Tue Jul 31, 2007 6:48 am

nevermind! you can bump this post.. i figured it out.
jboesch
 
Posts: 2
Joined: Tue Jul 31, 2007 6:34 am

Postby richardk » Sat Aug 04, 2007 12:13 pm

Then you should have posted the answer/solution for others.

You only want to match /, so use ^$ (nothing, because the / has been stripped)
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.utrack\.org$ [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.utrack\.org$ [NC]
RewriteRule ^$ http://%1.utrack.org/accounts/? [R,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 37 guests

cron