SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2004
    Location
    Nova Scotia, Canada
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Redirecting a parked domains' sub directory

    Hello,

    I have a parked domain that redirects to a sub directory.

    Sample Code:
    Code:
    RewriteCond %{HTTP_HOST} ^(www\.)?parkeddomain.com$ [NC] 
    RewriteRule ^(.*)$ http://www.newdomain.com/sub-directory/$1 [R=301,L]
    I need to redirect a sub directory off the parked domain and point it to a different sub directory on the newdomain.com.

    Basically what I need to do while preserving the above rewrite condition is have parkeddomain.com/directory/ point to newdomain.com/different-directory/

    Can this be done?
    ----
    Cheers, Jamie

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    J,

    Yes.

    Okay, WHY use mod_rewrite to direct the parked domain? The normal way to do this is to set its DocumentRoot TO the subdirectory because your parked domain will NOT be seen, only NEWdomain (because of the absolute redirect).

    Second, in answer to your question, if you need to redirect subdirectories, do it in the parkeddomain's .htaccess and specify that subdirectory with the appropriate (absolute or other) redirect.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •