Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Apr 2014
    Location
    London
    Posts
    22
    Plugin Contributions
    0

    Default Re: htaccess redirect from old subdirectory site to new subdomain site

    hi again lhungil

    Thanks for replying in so much detail. Greatly appreciated. I'm still trying to digest it all (while trying to pretend I know what I'm doing - what a joke! if pigs could fly etc etc.)

    I think I need to explain the structure of what's on my cpanel. Basically it's got 3 different websites on it - they don't have anything to do with each other. Two are different small business websites and one is an art showcase.

    The primary domain (ecl.com) is a small business website - mainly a static website with 5 info pages, another 4 pages with quizzes and a contact form. The plan is to change this over to a wordpress site eventually.

    The art showcase is an addon domain in folder /artwebsite.com in /public_html

    The website with the zencart is another addon domain (/mydomain.com in /public_html). This is the biggest website of the 3.
    The old (and still active) site format is
    www.mydomain.com/what-are-now-ezpages.shtml (about 15 pages of these)
    and
    www.mydomain.com/zencart
    The test website is the folder /shop in public_html and it is installed as a subdomain (shop.mydomain.com).
    If I understood correctly I do not need to do any redirection when I finally move shop.mydomain.com to mydomain.com (except for the following:-
    RewriteCond %{REQUEST_URI} ^/?zencart/
    RewriteRule ^(/?)zencart/(.*)$ $1$2
    which should come before the CEON uri mapping code in .htaccess in mydomain.com

    I was told by my hosting company that I can have different websites on same cpanel. When I did site:domain.com searches for all three, only pages from one domain show up and there's no crossing over. In awstats however, both addon domains show as subdomains of the primary domain - but I guess this doesn't matter much as only I see the awstats. I hope having 3 sites on same cpanel is not effecting SEO for the addon domains - or the primary domain for that matter. Any thoughts on this? I read somewhere that I should probably have [R301] redirects for both the addon domains to redirect subdomain.primarydomain.com to domain.com (i.e artwebsite.ecl.com to artwebsite.com) for SEO reasons. What's your take on this?

    Oh and I've installed the EZpages meta tag fields plugin on the test site. Thank you :)

    Now I need a break coz I'm seeing double About to make that half full /empty glass into 1/4 : 3/4
    Cheers!

  2. #2
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: htaccess redirect from old subdirectory site to new subdomain site

    Quote Originally Posted by Millie63 View Post
    ... In awstats however, both addon domains show as subdomains of the primary domain - but I guess this doesn't matter much as only I see the awstats. ... I read somewhere that I should probably have [R301] redirects for both the addon domains to redirect subdomain.primarydomain.com to domain.com (i.e artwebsite.ecl.com to artwebsite.com) for SEO reasons. What's your take on this?
    ...
    Unless another.domain.tld is linked to, most SEs will never see another.domain.tld (only the add-on domain's name). But to be on the safe side one could redirect all requests to a specific FQDN (Fully Qualified Domain Name). Keep in mind Zen Cart will only generate links using the defined values of HTTP_SERVER and HTTPS_SERVER (which should contain the desired FQDNs).

    Code:
    ###############################################################################
    # Enable mod_rewrite processing using the rules in this .htaccess file
    ###############################################################################
    # Notes: 
    #
    # For mod_rewrite to work, the Apache server option to allow symbolic links to
    # be followed must be enabled. Most providers supporting mod_rewrite will
    # already have it enabled for you, but if your rewrite rules are not working
    # you can un-comment the first directive below to manually enable the option.
    #
    # Don't forget, mod_rewrite directives are processed in order until a matching
    # RewriteRule with the [L] flag is encountered. So the more specific a rule is
    # the closer it should appear to the top of this file.
    #
    # These directives should only appear once in the .htaccess file
    ###############################################################################
    #Options +FollowSymLinks
    RewriteEngine on
    
    ###############################################################################
    # Redirect to the desired FQDN if the request was not for the desired FQDN
    ###############################################################################
    # Notes: 
    #
    # This utilizes a HTTP/301 response. Any POST data will be discarded. 
    ###############################################################################
    RewriteCond %{HTTP_HOST} !host\.domain\.tld$ [NC]
    RewriteRule ^.*$ http://host.domain.tld%{REQUEST_URI} [R=301,QSA,L]
    
    ###############################################################################
    # Remove "zencart" if present from the request URI
    ###############################################################################
    # Notes:
    #
    # Some servers add a leading slash "/" and others do not. This rule attempts
    # to handle both, but one may need to alter this by hand on some servers.
    ###############################################################################
    RewriteCond %{REQUEST_URI} ^/?zencart/
    RewriteRule ^(/?)zencart/(.*)$ $1$2
    
    ###############################################################################
    # CEON URI Mapping
    ###############################################################################
    Last edited by lhungil; 29 May 2014 at 10:37 PM.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

 

 

Similar Threads

  1. v151 Need to redirect from old site links (including search engine links) too new site
    By swdynamic in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 15 Jun 2015, 04:40 AM
  2. What do I need in .htaccess to redirect to my new site?
    By marvin in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 18 Mar 2013, 09:01 PM
  3. Redirect From Old Site To New Site
    By devlin in forum General Questions
    Replies: 4
    Last Post: 14 Mar 2012, 01:25 PM
  4. v150 Redirect from old osc site to new zc site?
    By DIHI in forum General Questions
    Replies: 2
    Last Post: 2 Feb 2012, 05:42 PM

Posting Permissions

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