• Resolved anatolyv

    (@anatolyv)


    Hi, I have several sub-domains that I need to redirect to the main home page of my site. Examples:
    – kate.powerofaloe.com should open powerofaloe.com.
    – john.powerofaloe.com should open powerofaloe.com.
    I need to do this so that JavaScript on the main home page can detect ‘john’ or ‘kate’ in the URL of the sub-domain and customize the main page for either John or Kate. This way I will have one site that will look different for different owners of my sub-domains.

    I created sub-domains with my hosting provider and pointed them to a separate sub-directories under public_html. I do not know how to redirect them to the main page. Forwarding them at the hosting provider level won’t work because it will be forwarded before the page opens and I won’t be able to read the sub-domain with JavaScript. Can you help me with this? Thank you!

    https://www.ads-software.com/plugins/cleverwise-redirect-it/

Viewing 16 replies (of 16 total)
  • Plugin Author Me

    (@cyberws)

    Well 302 just tells the search engine the link isn’t going to be redirect forever (even if it is) so note the original URL. 301 tells the search engine the link is going to be forever redirected so don’t note it.

    You are wanting Google and co to note the kate, john, etc and by using 301 you are telling them don’t save it which is what the 302 will accomplish. In general you want to use 301 to pass along the linking power and such but your case is different. You will still get hit with the duplicate content “penality” but in this case that isn’t the issue. You are wanting the search engines to note and save the URL so it can be displayed when a visitor types it into their database.

    Another option is the 200 route. There are multiple ways to accomplish this and that is have a script respond to ANY url at the subdomains with a standard page exists (200 code) then redirect to the main site while setting a cookie. Since a 200 message is provided the search engines will see a page exists and note the URL. This should eventually start bringing up the URLs when people type them into Google because a page will be found.

    No keyword Google search but URLs typed into the search box. As with most technology there are multiple ways to approach this issue.

Viewing 16 replies (of 16 total)
  • The topic ‘Redirecting sub-domains to the main home page’ is closed to new replies.