Doubt on Mod_rewrite for all the pages

Discussion in 'Apache' started by kks_krishna, Jan 22, 2009.

  1. #1
    HI,

    I have one doubt on Mod_rewrite. I have sub domain named "sub.domain.com".
    What ever the requests are coming to this sub domain should be redirected to the "www.domain.com/articles/sub/page/1/" how can I do that in .htaccess file. Please help me as I have moved all the files in that sub domain to new directory.
     
    kks_krishna, Jan 22, 2009 IP
  2. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #2
    Create an .htaccess file and put it in that folder where your subdomain files were. Put this into your .htaccess:
    
    RewriteEngine on
    RewriteRule (.*) http://www.domain.com/articles/sub/page/1/ [R=301]
    
    Code (markup):
     
    pr0t0n, Jan 24, 2009 IP