Redirect domain/user to user.domain ONLY IF folder 'user' doesn't exist

Posted by ThatScriptGuy, 05-07-2007, 04:22 PM
Well, I thought I knew enough about my .htaccess stuff to do this, but I can't seem to work it out. What I want to do is if a user visits domain.com/folder, we check to see if the folder exists. If so, show as normal (IE domain.com/support) If a user visits domain.com/dynamicusername (dynamicusername is not a physical folder), redirect to dynamicusername.domain.com Any ideas on this one?

Posted by activelobby4u, 05-07-2007, 06:59 PM
its best you implement this using a php code.. redirect any page (anywhere in the home dir) to index.php first and then chek the condistion for the folder and redirect.

Posted by ThatScriptGuy, 05-07-2007, 07:12 PM
If I wanted/needed to do it in PHP, I would have done it. I'm looking for an .htaccess specific way to do this. (I know it's possible to do..I'm just not that savvy in the syntax yet)

Posted by ThatScriptGuy, 05-07-2007, 07:17 PM
For future references for other members, this was accomplished using the following code: Kevin

Hai trovato questa risposta utile?

 Stampa Articolo

Leggi anche

utterly confused about external links?

Posted by gg2327, 09-14-2007, 11:02 PMhave a few different list of links in my link section for...

3-line PHP chat

Posted by Looie, 01-15-2008, 03:28 PMJust an idea I had http://www.ehwtf.com/stuffz/chat...

Exchange Replication?

Posted by regmac01, 09-16-2007, 12:19 AMWhat would be the best way to replicate two exchange...

reverse dns?

Posted by olddocks, 01-13-2008, 05:55 PMi read somewhere that genuine emails i send from my site...

WHM to point site to home server

Posted by kiwami, 05-04-2007, 12:19 PMwhats up fellers, i'm attempting to point my design site...