1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to have a second domain pointing to an inner page?

Discussion in 'WordPress' started by sarahk, Jun 26, 2014.

  1. #1
    I've got a club site that uses wordpress and there is a section of the club that has their own domain and wants to point to an inner page. It's not appropriate to use multisite.

    I've had a look for a plugin that will allow me to redirect but haven't found anything. Before I write one I though I'd check in - does anyone know of one?

    I did find the pronamics plugin but it needs to create the landing page whereas we have an existing page that we want to land on.

    Essentially all we need to do is
    • is the query string empty or /
    • if so check the domain - does it match one of our special cases?
      yes, apply redirect;
      no, do nothing.
     
    sarahk, Jun 26, 2014 IP
  2. TIEro

    TIEro Active Member

    Messages:
    741
    Likes Received:
    177
    Best Answers:
    5
    Trophy Points:
    70
    #2
    If you point a domain name at an inner page, that will be the root of said domain - your site probably won't work for people on that domain, since it requires the WP install (and all the included php files and so on) to run.

    If you just want that domain to land on a specific - and separate - landing page, then allow them full, normal access to the whole site, it may be better to build a copy of the page in HTML, put that in the root of the "other" domain and adjust all the links so they go to your main site. i.e. Have a separate landing page on that domain.

    If you want them to start on a specific page, but then use the whole site normally, you can point the "other" domain name at the root, same as your main one, and use a complicated set of .htaccess commands. I believe that can detect the previous page (i.e. anywhere but the "other" domain) and leave the user alone, as well as picking up the other domain name and redirecting them to the desired page (i.e. treating it as if they were referred to the primary domain by the referring one, and popping them off to the landing page - after which their referring domain will be the main one, so they won't get redirected from the home page).

    (I have no clue how to do this: I suck at .htaccess! Someone on here or Stackoverflow would know.)

    Alternatively, a wee bit of php with sessions would probably do the trick.
     
    TIEro, Jun 27, 2014 IP
  3. manish_khanna

    manish_khanna Member

    Messages:
    58
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    35
    #3
    you can use a 301 redirect,
    Its done from Cpanel Under Park Domains.

    Or you can add these links to .htaccess

    RewriteCond %{HTTP_HOST} ^yournewdomainname\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.yournewdomainname\.com$
    RewriteRule ^(.*)$ "http\:\/\/www\.yoursitename\.com\.au/yournewpagename_url" [R=301,L]
     
    manish_khanna, Jul 14, 2014 IP
  4. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    405
    Best Answers:
    21
    Trophy Points:
    295
    #4
    Nigel Lew, Jul 14, 2014 IP
  5. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #5
    Hey, Nigel, I've fixed it through the plex control panel. Would be a cool option to have though.
     
    sarahk, Jul 15, 2014 IP