The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

frustrating redirect

Discussion in 'General Discussion' started by afallison, Oct 17, 2009.

  1. afallison

    afallison Registered

    Joined:
    Oct 17, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    i dont know how to ask this or if it is even possible. basically i want to redirect several pages to one page. for example:

    domain1.com/123
    domain2.com/123
    domain3.com/123

    -----redirect to-----

    domain10.com

    i tried using all public domains, entered the "123" and the redirect page and ticked redirect with or without www. the only domain that will redirect is the account domain, none of the addon domains will redirect. they will only give 404.

    any ideas?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    If you just want to redirect those domains to point to the main domain, instead of using addon domains ad redirects, why not use the parked domains feature instead? This will give you what you seek, only catch is once at the site from a parked domain, any internal links clicked will be for the main domain, not the parked domain.
     
  3. afallison

    afallison Registered

    Joined:
    Oct 17, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    thanks for the response. i dont want the root of those domains to redirect to my new domain, i want a subdirectory of all my domains to redirect to a specific domain.

    domain1.com/sub redirects to domain10.com
    or
    domain2.com/sub22 redirects to domain.com

    i dont want to create a php redirect script for each subdirectory since it can be a pain to change (over 40 seperate scripts). i can get the account domain to work, but not the addons.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Sorry, I misread this.

    I just tested this below, and it works. Only difference is I used a parked domain instead of an addon.

    In redirects section I set things like this:

    Type: Permanent

    I selected the parked domain instead of leaving it to All Public Domains.
    I typed in 123 after the / on the second box.

    Redirects to-> I set to: http://google.com

    I left redirect with or without www and did not check the wildcard.

    If I check the url myparkeddomain.com/123/ it goes directly to google as expected.

    In that accounts htaccess the redirect for it looks like this:

    RewriteCond %{HTTP_HOST} ^myparkeddomain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.myparkeddomain.com$
    RewriteRule ^123\/?$ "http\:\/\/google\.com\/" [R=301,L]

    Not sure if that helps or not.
     
Loading...

Share This Page