Dynamic Subdmains

Using a single web hosting account to host multiple sites

Postby richardk » Wed Jul 19, 2006 11:25 am

Maybe it's the "?:"?

Try this:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?(.+)\.DOMAIN$ [NC]
RewriteRule ^(.*)$ /index.php?sub=%2&uri=$1 [L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby uoitguy » Wed Jul 19, 2006 1:29 pm

I realized ashamedly that I don't believe the redirection is working at all. I have changed my code so I am now using goto.php instead of index.php

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?(.+)\.DOMAIN$ [NC]
RewriteRule ^(.*)$ /goto.php?sub=%2&uri=$1 [L]


Now there is no effect at all. Sorry to keep troubling you, but you've been a great help :)
uoitguy
 
Posts: 14
Joined: Sun Jul 16, 2006 12:22 pm

Postby richardk » Wed Jul 19, 2006 1:37 pm

Do you even know that mod_rewrite works at all? To test, put this in your .htaccess file:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

# test for mod_rewrite
# /google --> http://www.google.com/
RewriteRule google http://www.google.com/? [R,L]

Now go to "your-domain.com/google", if you are redirected to Google mod_rewrite works, else talk to your host.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby uoitguy » Wed Jul 19, 2006 1:40 pm

Okay, mod_rewrite is definitely enabled. I'll just have to keep fiddling...
uoitguy
 
Posts: 14
Joined: Sun Jul 16, 2006 12:22 pm

Postby uoitguy » Wed Jul 19, 2006 4:39 pm

Well, I have things working exactly the way I wanted. Thanks richardk!
uoitguy
 
Posts: 14
Joined: Sun Jul 16, 2006 12:22 pm

Previous

Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 13 guests

cron