Rewrite URL to subdomain using HTACCESS need help

Discussion in 'Apache' started by darkc99, May 13, 2011.

  1. #1
    hello
    i need little help in url rewrite

    i have website www.w3scan.net

    my default url display is like that
    www.w3scan.com/www.digitalpoint.com ( will show digital point report)

    so i want to rewrite url to subdomain like that

    www.digitalpoint.com.w3scan.net
    or digitalpoint.com.w3scan.net


    so please help me

    i did little work on that
    >> i setup wildcard for w3scan in my panel ( *.w3scan.net)
    >> also i modified httpd.conf for virtual subdomains
    <virtualhost>
    ServerAlias www.w3scan.net w3scan.net *.w3scan.net
    </virtualhost>
    >> ????


    now third setup is to edit .htaccess file

    so am little confuse mean i weak with htaccess configuration

    my w3scan current htacess file
    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule www.(.*) web.php?url=$1
    RewriteRule sitemap/(.*) mapdi.php?page=$1
    RewriteRule tags_(.*)\.html$ tags.php?keywords=$1
    RewriteRule ^([^-]*)-page-([^-]*)\.html$ tags.php?keywords=$1&page=$2 [L]
    RewriteRule ^sitemap_([^-]*)\.html$ sitemap_web.php?page=$1 [L]
    
    Code (markup):
    our work is to play with that potion of htaccess
    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule www.(.*) web.php?url=$1
    
    Code (markup):


    so help me little........................
     
    darkc99, May 13, 2011 IP
  2. darkc99

    darkc99 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    sorry guys i tried to edit post but copies 3 times automatically same post .....??????
     
    darkc99, May 13, 2011 IP
  3. msk19994

    msk19994 Well-Known Member

    Messages:
    1,030
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    160
    #3
    do you want to redirect your main site url to sub domain >>

    like www.yourdomain.com to game.yourdomain.com ?
     
    msk19994, May 13, 2011 IP
  4. msk19994

    msk19994 Well-Known Member

    Messages:
    1,030
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    160
    #4
    hey check this if it works

     
    msk19994, May 13, 2011 IP
  5. darkc99

    darkc99 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    no i want my site url as subdimain
    like www[dot]w3scan[dot]net/www[dot]domain[dot]com // default url
    to
    domain[dot]com[dot]w3scan[dot]net // want that url structure
     
    darkc99, May 13, 2011 IP
  6. darkc99

    darkc99 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ok let me check ........ your above lines
     
    darkc99, May 13, 2011 IP
  7. darkc99

    darkc99 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    not working ........
     
    darkc99, May 13, 2011 IP
  8. darkc99

    darkc99 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    the above code will redirect primary domain to some test domain but i want to rewrite my urls as subdomain
    like www[dot]w3scan[dot]net/www[dot]domain[dot]com // default url
    to
    domain[dot]com[dot]w3scan[dot]net // want that url structure
     
    darkc99, May 13, 2011 IP
  9. msk19994

    msk19994 Well-Known Member

    Messages:
    1,030
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    160
    #9
    do you have an example url of

    www[dot]w3scan[dot]net/www[dot]domain[dot]com // default url
     
    msk19994, May 13, 2011 IP
  10. darkc99

    darkc99 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    ya check out www[dot]w3spy[dot]net

    i want to rewrite my urls like that site
     
    darkc99, May 13, 2011 IP