Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: How to redirect a product url to sub.domain?

    htaccess files are a program of their own, to support a solution need to see what it is you have. Please post your htaccess file but obscure the admin directory if it is included. Also, before posting it please press the # button in the menu bar of the message box when you are replying.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #12
    Join Date
    Sep 2008
    Posts
    397
    Plugin Contributions
    0

    Default Re: How to redirect a product url to sub.domain?

    Code:
    RewriteEngine On
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^/(demoshop|failed_auth\.html).*$ [NC]
    RewriteRule . - [L]
    </IfModule> 
    
    # Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
    RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,5}$ [NC]
    # Don't rewrite admin directory
    RewriteCond %{REQUEST_URI} !^/hided
    # Don't rewrite editors directory
    RewriteCond %{REQUEST_URI} !^/editors [NC]
    # Don't rewrite cPanel directories
    RewriteCond %{REQUEST_URI} !/cpanel [NC]
    RewriteCond %{REQUEST_URI} !/frontend [NC]
    # Handle all other URIs using Zen Cart (index.php)
    RewriteRule .* index.php?%{QUERY_STRING} [L]
    
    Redirect 301 /s-e-o-page https://www.sub.mysite.com/s-e-o-newpage
    Please help. Thanks in advance!
    Last edited by hara; 30 May 2016 at 06:52 AM.

  3. #13
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: How to redirect a product url to sub.domain?

    You've got a lot going on. With CEON uri installed and this redirect to your "disabled" product it almost looks like the new 301 redirect should be above the other rewriteRules but also looks like might want to either stop rewriting once s-e-o-page is found.

    Thing is, now that you have been working to use your sub-domain your rewriteCond statements likely don't look right for your sub-domain condition. Have you gone to the installation check to see what .htaccess rules it recommends at this point? Normally the rewriteConds should include the subdirectory in which the store is installed. Those don't appear here...

    What does the s-e-o-page represent? Is that to which your site goes when a page is not found?

    BTW, I won't be able to help for much longer this go round because of time differential, etc...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #14
    Join Date
    Sep 2008
    Posts
    397
    Plugin Contributions
    0

    Default Re: How to redirect a product url to sub.domain?

    Quote Originally Posted by mc12345678 View Post
    ......................
    What does the s-e-o-page represent? Is that to which your site goes when a page is not found?
    ...
    No, s-e-o-page represent a old site page that using seo.
    I'm trying to redirect to this page: https://www.sub.mysite.com/s-e-o-newpage
    The problem now is, an unwanted folder added to new site page like https://www.sub.mysite.com/unwanted_.../s-e-o-newpage. So get page not found in result.

    As I understand, CEON uri module and rewriteCond cause the problem. It seems things are getting even more complicated. I will work more harder for it.

    Thanks in advance!

  5. #15
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: How to redirect a product url to sub.domain?

    Quote Originally Posted by hara View Post
    No, s-e-o-page represent a old site page that using seo.
    I'm trying to redirect to this page: https://www.sub.mysite.com/s-e-o-newpage
    The problem now is, an unwanted folder added to new site page like https://www.sub.mysite.com/unwanted_.../s-e-o-newpage. So get page not found in result.

    As I understand, CEON uri module and rewriteCond cause the problem. It seems things are getting even more complicated. I will work more harder for it.

    Thanks in advance!
    Did you previously have something like CEON URI installed on your system?

    If so, then yes by continuing down this path rather than doing the upgrade as previously suggested you have a lot of work ahead of you. Still not sure why you continue to make this ever harder, but here goes.

    For every entry in your ceon_uri_mappings table, the active_status of your old URI must be made false (0). Then, for all of the entries other than the uri, two things need to happen, one a new entry with active_status of 1 needs to be made for all of the other matching data with the path to your sub-directory or sub-domain whichever is being used and that path needs to be based off of whatever you have for your HTTP_SERVER style info. This is because the ceon software, when it receives the request for that specific uri (that is no longer "correct") with the status marked as false, will look for an active uri that has all of the other matching information. It will then respond/report that the new uri is what you have entered above or that the product is not found.

    Then you need to fill in the gaps that might exist such that you have an active uri for your product in your store.

    So, one thing to note though is that you can not have the same uri as both active and inactive or two or more of either as that could cause unpredictable results.

    Now, if the uri path is to be the same now as it was before, then you need to only update the other values to reflect the new data such as the products_id being something different now than it was before. But also would need to redirect a the request to go to your old site to now go to your sub-domain and that needs to be done before/above the existing CEON uri htaccess info and such that the request is allowed to continue down/forward (not use [L] on the end of the rewriterule) I would also suggest that the rewrite conditions include a check for the http_host to validate that in fact the request is being made against your new sub-domain and to apply those rules only against this sub-domain.

    Like said, would have been much easier to setup a third version of the site using the files from the second site, import the database of the original site, update that database and then place your updated files from the second/third site where your primary site is and again update the database of the first site using the process discovered/identified in upgrading that same data in the third site. Then delete the second site and database and use the third site as a development site where you could try out new things before applying to your primary site. Of course add some protection like put it in maintenance mode so others shouldn't be able to access it...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #16
    Join Date
    Sep 2008
    Posts
    397
    Plugin Contributions
    0

    Default Re: How to redirect a product url to sub.domain?

    Thank you very much mc12345678.

    I will take your expert suggestion to upgrade to latest version eventually.
    At same time now, I will still take little time to figure it and test if redirect can be achieve. My site still live and product's description can not be updated (editor no longer working on PHP5.6 higher version), and some customers complaint reset password function doesn't work.

    Could you advise which file for editing product's description? (I did it before but forgot now).

    Thanks you again for your time.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. How to redirect image URL?
    By musicfreer in forum General Questions
    Replies: 4
    Last Post: 17 Jun 2011, 11:53 PM
  2. Replies: 5
    Last Post: 15 Dec 2010, 11:05 PM
  3. Replies: 3
    Last Post: 13 Dec 2010, 05:28 PM
  4. how do i redirect my second domain?
    By weber in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 18 Mar 2009, 05:18 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