Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2009
    Posts
    85
    Plugin Contributions
    0

    Default .htaccess rewrite with folders and Private SSL?

    Hello,
    I just installed a SSL certificate,
    and i would like to know is there any way to do a mod rewrite,
    that turns and work www.domain.com to a sub-folder but still shows www.domain.com on the title bar, instead of www.domain/com/folder when applying a redirect.
    This is what i done and works in http, but no longer true in SSL servers,RewriteEngine on

    #RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
    #RewriteCond %{REQUEST_URI} !^/main/
    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteRule ^(.*)$ /main/$1

    #RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
    #RewriteRule ^(/)?$ main/index.php [L]

  2. #2
    Join Date
    Jun 2008
    Location
    Washington, DC
    Posts
    785
    Plugin Contributions
    7

    Default Re: .htaccess rewrite with folders and Private SSL?

    This works for me:

    Code:
    # Makes catalog seem like the root in the browser address.
    # change domain to your url
    # change catalog to your sub folder name
    # the next 3 line are here if you do not have them already in the file.
    Options -Indexes
    RewriteEngine on
    Options +FollowSymLinks
    # 
    RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
    RewriteRule .* http://www.domain.com/ [L,R=301]
    RewriteRule ^$ catalog/index.php [L]
    RewriteCond %{DOCUMENT_ROOT}/catalog%{REQUEST_URI} -f
    RewriteRule .* catalog/$0 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* catalog/index.php?q=$0 [QSA]
    Skip
    • 446F63746F722057686F •

  3. #3
    Join Date
    Jan 2009
    Posts
    85
    Plugin Contributions
    0

    Default Re: .htaccess rewrite with folders and Private SSL?

    skipwater,
    it works like a charm!!!!!!!!!
    Thank you very much!!!!!!!!

  4. #4
    Join Date
    Jan 2009
    Posts
    85
    Plugin Contributions
    0

    Default Re: .htaccess rewrite with folders and Private SSL?

    I just figued out something is that when i type www.domain.com, no matter what i type say www.domain.com/oooooooo or /rrrrrrrrrr, it gets displayed as my mainpage www.domain.com/rrrrrrrrr, can this be solved?thank you

  5. #5
    Join Date
    Jun 2008
    Location
    Washington, DC
    Posts
    785
    Plugin Contributions
    7

    Default Re: .htaccess rewrite with folders and Private SSL?

    That's one of the draw backs that I have not been able to work out.

    I assume that you are using an ZC error 404 trap in your htaccess file. Or something similar.
    Code:
    ErrorDocument 404 http://www.domain.com/index.php?main_page=page_not_found.php
    I know it looks funny but it is a file not found value. Just the address is not cleared when redirected to error page.

    Maybe someone else can come up with the clearing command?

    Skip
    • 446F63746F722057686F •

  6. #6
    Join Date
    Jan 2009
    Posts
    85
    Plugin Contributions
    0

    Default Re: .htaccess rewrite with folders and Private SSL?

    Skipwater, thanks very very much for your reply,
    I would like to ask a little bit more, is that where should the link error document should be placed?

  7. #7
    Join Date
    Jun 2008
    Location
    Washington, DC
    Posts
    785
    Plugin Contributions
    7

    Default Re: .htaccess rewrite with folders and Private SSL?

    As a start here is a link to all the error codes and what they mean.
    http://www.askapache.com/htaccess/ap...rdocument.html

    Zen Cart has a predefined error page which is: page_not_found.php

    To edit the contents of this page you can find it in your:
    /includes/templates/YOUR_TEMPLATE/templates/tpl_page_not_found.php

    As for the htaccess file just add this line with your url
    Code:
    ErrorDocument 404 http://www.domain.com/index.php?main_page=page_not_found.php
    • 446F63746F722057686F •

 

 

Similar Threads

  1. How do I use htaccess to not rewrite a subdomain?
    By Danielle in forum General Questions
    Replies: 3
    Last Post: 15 Feb 2012, 05:04 AM
  2. How to change .htaccess to rewrite the url? - Hard
    By musicpxg in forum General Questions
    Replies: 0
    Last Post: 30 Jul 2009, 09:05 AM
  3. Problems with SSL Folders
    By itinfraco in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 1 Dec 2008, 10:04 AM
  4. htaccess rewrite question
    By jeking in forum General Questions
    Replies: 12
    Last Post: 6 Mar 2008, 05:38 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR