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

Esta resposta foi útil?

 Imprimir este Artigo

Leia também

Traffic overusage

Posted by Salar, 01-14-2008, 03:59 PMhi, i have an VPS account at SolarVPS. I have had some bad...

How-To: PHP bbCode Function // Intermediate

Posted by JustinSmall, 09-21-2008, 03:49 PMIt wouldn't let me post this is the tutorial section,...

Going to start hosting...

Posted by Glexicon, 09-13-2001, 01:23 AMI would be getting rackshack.net servers to start my...

VB question

Posted by hopesfall, 03-10-2010, 12:42 AMI have a string of asterisks "*****" which are in...

No right click code

Posted by rumrunner439, 09-22-2008, 11:07 AMOk i saw some code that i though would stop right...