Rewriting a non existent to existing folder

Discussion in 'Site & Server Administration' started by steganos, Mar 6, 2008.

  1. #1
    Hello guys
    I wanna rewrite my non existent subdomains to my existing folders by mod_rewrite of course ^^

    nonexistentdomain.x48.org

    >>

    x48.org/nonexistentdomain

    when I try that code

    
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.x48.org
    RewriteCond %{HTTP_HOST} ([^.]+).x48.org
    RewriteRule ^(.*)$ 404.php?x=%1 [L]  
    
    PHP:
    It works like a babe but I dont wanna rewrite it to a php file

    when I try

    
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www.x48.org
    RewriteCond %{HTTP_HOST} ([^.]+).x48.org
    RewriteRule ^(.*)$ %1  
    
    PHP:
    works like a babe

    // Note: I configured the httpd.conf etc
     
    steganos, Mar 6, 2008 IP
  2. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Camay123, Mar 6, 2008 IP