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

¿Fue útil la respuesta?

 Imprimir éste Artículo

Leer también

Need to Delete a Cronjob via SSH

Posted by epic1231, 03-23-2007, 11:12 AMI have a cronjob that is still entered in my server, but...

[php] Need advices on writing a counter script

Posted by kennethinvest, 09-22-2008, 06:04 PMhello, I would like to make a very simple couter...

Load Balancing 2 Web servers and 2 MySQL Servers

Posted by YYamagishi, 03-28-2008, 04:02 AMHi, I was wondering if it is possible to cluster 2 web...

aletia reseller

Posted by hostchecker, 09-27-2001, 05:36 PMwhas the URL for aletia reseller plans? Posted by...

Having trouble blocking google spider

Posted by lhmx, 11-15-2012, 02:51 AMI'm having some trouble blocking google (and others) from...