Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Apr 2015
    Location
    USA
    Posts
    31
    Plugin Contributions
    0

    Default Help Please - need help with .htaccess file

    I'm sure this is a stupid question but I'm new to this. I installed Ultimate SEO URL and I'm getting a 404 error. I'm pretty sure I know the problem is in my .htaccess file But I don't know how to insert the new Apache directives from Ultimate SEO URL into my old .htaccess file seeing as I cant have 2 in the same directory with the same name. I looked all around and can't figure it out. Everything just says to put the directives together in the same file but doesn't explain how to do it.

    This is whats in my old .htaccess file

    <IfModule mod_deflate.c>
    SetOutputFilter DEFLATE
    <IfModule mod_setenvif.c>
    # Netscape 4.x has some problems...
    BrowserMatch ^Mozilla/4 gzip-only-text/html

    # Netscape 4.06-4.08 have some more problems
    BrowserMatch ^Mozilla/4\.0[678] no-gzip

    # MSIE masquerades as Netscape, but it is fine
    # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

    # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
    # the above regex won't work. You can use the following
    # workaround to get the desired effect:
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

    # Don't compress images
    SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
    </IfModule>

    <IfModule mod_headers.c>
    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary
    </IfModule>
    </IfModule>


    And this is what I have in the new .htaccess file

    ###############################################################################
    # Add custom headers and options
    ###############################################################################
    # Notes:
    #
    # Examples: Adding IE compatibility / edge flags, language and encoding flags,
    # php or suphp directives, configure other Apache modules such as page_speed,
    # and enable or disable Apache httpd options.
    #
    # Do NOT configure anything directly relating to physical or virtual resources
    # in this section. These should be addressed later on in this file.
    ###############################################################################
    #Options -Indexes

    ###############################################################################
    # Enable mod_rewrite processing using the rules in this .htaccess file
    ###############################################################################
    # Notes:
    #
    # <IfModule> should be avoided at all costs. If mod_rewrite is not available
    # it is almost always better to return HTTP 500 status. This way we see there
    # is an issue as soon as the .htaccess file is uploaded.
    #
    # 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.
    ###############################################################################
    #Options +FollowSymLinks
    RewriteEngine on

    ###############################################################################
    # Tell mod_rewrite where this file is relative to the server document_root
    ###############################################################################
    # Notes:
    #
    # This directive should only be enabled if this .htaccess file is not placed
    # in the document_root (usually public_html, www, or web) of the (sub)domain.
    #
    # An easy way to determine the location relative to the server document_root is
    # to look at the URL used to access a file in this folder. For example if you
    # access a "page" in the same folder as this file by typing in the URL
    # "www.mydomain.com/myfolder/index.html" then "myfolder" will be the location
    # of this file relative to the server document_root.
    #
    # Another quick and easy way to determine the correct setting for this is to
    # look at the defined value for DIR_WS_CATALOG and DIR_WS_HTTPS_CATALOG in
    # Zen Cart's configure.php files. All three values should match.
    #
    # Don't forget the leading and trailing /. This directive requires both!
    ###############################################################################
    #RewriteBase /shop/


    ###############################################################################
    # Redirect if request was for index.php (no query)
    ###############################################################################
    # Notes:
    #
    # This is only required if the site generates references to index.php with no
    # parameters. This rule will force a 301 redirect to the site root when a
    # request is made for "/index.php" with no query terms (?key=value).
    ###############################################################################
    #RewriteCond %{QUERY_STRING} ^$
    #RewriteRule ^index\.php$ / [R=301,L]


    ###############################################################################
    # Add any custom 301 redirects
    ###############################################################################
    # Notes:
    #
    # In general these should be few and far between. If you use a RewriteRule
    # be sure to add the L flag to let Apache mod_rewrite know to stop processing
    # and skip any RewriteRules defined later in the .htaccess file.
    ###############################################################################


    ###############################################################################
    # Redirect if request was for index.php (with or without query)
    ###############################################################################
    # Notes:
    #
    # This is a performance optimization. If the request is for index.php simply
    # pass the request on and do not process any other mod_rewrite directives in
    # this file.
    #
    # Basically this avoids the overhead of checking if index.php is a real file
    # or directory (used in subsequent mod_rewrite rules) before sending the
    # request to index.php.
    ###############################################################################
    RewriteRule ^index\.php$ - [L]


    ###############################################################################
    # Start Ultimate (SEO) URLs
    ###############################################################################
    # Notes:
    #
    # You should not make any changes in this section unless you really understand
    # how it will impact your web site. Mistakes can break things.
    ###############################################################################

    # Handles the new URL formats
    RewriteRule ^(.*)-c-([0-9_]+)/(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$4&cPath=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$4&cPath=$2&%{QUERY_STRING } [L]

    # Original (unchanged) URL formats
    RewriteRule ^(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-m-([0-9]+)(.*)$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-ezp-([0-9]+)(.*)$ index\.php?main_page=page&id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-c-([0-9_]+)(.*)$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]

    # Rewrite all other requests (if the file / directory does not exist)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index\.php?main_page=$1&%{QUERY_STRING} [L]

    ###############################################################################
    # Add any other directives relating to the handling of physical files
    ###############################################################################
    # Notes:
    #
    # If processing makes it this far, the request was for a real file or folder.
    # Example: Adding further processing related to browser caching or security.
    ###############################################################################


    PLEASE HELP

  2. #2
    Join Date
    Apr 2015
    Location
    USA
    Posts
    31
    Plugin Contributions
    0

    Default Re: Help Please - need help with .htaccess file

    Oh and my site URL is www.seductiveadults.com

    At the moment I just have the module turned off so my site is functioning properly until I get this resolved. I'm at a loss, I've try messing with the files for like 8 hours and I cant seem to get it to work. Probably because I have absolutely no idea what I'm doing... lol, someone is gonna see this post and be like are you kidding me? You didn't know how to do that? hahaha

    Anyway, any help would be awesome.

  3. #3
    Join Date
    Apr 2015
    Location
    USA
    Posts
    31
    Plugin Contributions
    0

    Default Re: Help Please - need help with .htaccess file

    Oh and my site URL is www.seductiveadults.com

    At the moment I just have the module turned off so my site is functioning properly until I get this resolved. I'm at a loss, I've try messing with the files for like 8 hours and I cant seem to get it to work. Probably because I have absolutely no idea what I'm doing... lol, someone is gonna see this post and be like are you kidding me? You didn't know how to do that? hahaha

    Anyway, any help would be awesome.

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

    Default Re: Help Please - need help with .htaccess file

    Quote Originally Posted by timb22 View Post
    I'm sure this is a stupid question but I'm new to this. I installed Ultimate SEO URL and I'm getting a 404 error. ...
    I'm seeing a 500 (internal server error) not a 404. Do you have access to the server error logs (what do they list)? The server error logs will indicate the cause of the internal server error (unless the host has disabled logging errors).

    Most common causes will be:
    • Wrong .htaccess file was modified / replaced
    • Server does not have mod_rewrite enabled
    • Server does not allow mod_rewrite directives in .htaccess files (overly paranoid security)
    • Server has disabled other items (such as follow symbolic links) causing mod_rewrite to fail
    • Server is using some sort of internal proxy or REWRITE to access the web root (cheap shared hosting plans often do this often for "secondary" domains)


    For the first "guess"... Was the original .htaccess file in the SAME folder as the Zen Cart installation? For example "/public_html/.htaccess"? Or was the original / modified .htaccess file in a parent folder (outside the public web root)?

    For the rest may want to ask your hosting provider to investigate the cause. The middle three you cannot fix (only a server administrator can). The last one is something one can create a "workaround" specific to the hosting environment to address... But one would know more details about the server configuration.


    P.S. The lines from your original .htaccess file look suspiciously close to the .htaccess file used by cPanel w/ "optimize server" enabled (note this file is usually located outside the web root on server's w/ cPanel - not inside the folder where Zen Cart is installed). As per the Ultimate URLs installation instructions the supplied .htaccess file goes in the same folder where Zen Cart is installed (or is merged with any existing .htaccess file in the same folder where Zen Cart is installed).
    Last edited by lhungil; 6 Apr 2015 at 07:01 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

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

    Default Re: Help Please - need help with .htaccess file

    Note the following:
    Code:
    ###############################################################################
    # Redirect if request was for index.php (with or without query)
    ###############################################################################
    # Notes:
    #
    # This is a performance optimization. If the request is for index.php simply
    # pass the request on and do not process any other mod_rewrite directives in
    # this file.
    #
    # Basically this avoids the overhead of checking if index.php is a real file
    # or directory (used in subsequent mod_rewrite rules) before sending the
    # request to index.php.
    ###############################################################################
    RewriteRule ^index\.php$ - [L]
    It performs an action on index.php whether there is something that follows it or not... Then stops processing all the rules below it... Then the rules below it (stopped by this one) are all about USU and include index.php.

    I would suggest commenting out that rewriteruleby adding a hash (#) followed by a space...

    But then, lhungil has also provided some input on the issue that may be more directly applicable.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Apr 2015
    Location
    USA
    Posts
    31
    Plugin Contributions
    0

    Default Re: Help Please - need help with .htaccess file

    Thank you for responding I meant to put 500 sorry. I was a 404 before on something else but I fixed that.

    The .htaccess file is the original file that came with the install in my root directory outside of public_html

    Name:  this.gif
Views: 555
Size:  18.2 KB

    That's where it is

  7. #7
    Join Date
    Apr 2015
    Location
    USA
    Posts
    31
    Plugin Contributions
    0

    Default Re: Help Please - need help with .htaccess file

    that image was worthless lol

    Quote Originally Posted by timb22 View Post
    Thank you for responding I meant to put 500 sorry. I was a 404 before on something else but I fixed that.

    The .htaccess file is the original file that came with the install in my root directory outside of public_html

    Name:  this.gif
Views: 555
Size:  18.2 KB

    That's where it is

  8. #8
    Join Date
    Apr 2015
    Location
    USA
    Posts
    31
    Plugin Contributions
    0

    Default Re: Help Please - need help with .htaccess file

    Are you talking about hashing out

    "RewriteRule ^index\.php$ - [L]"

  9. #9
    Join Date
    Apr 2015
    Location
    USA
    Posts
    31
    Plugin Contributions
    0

    Default Re: Help Please - need help with .htaccess file

    Thanks for the input I'll mess with this and see what I can figure out

  10. #10
    Join Date
    Apr 2015
    Location
    USA
    Posts
    31
    Plugin Contributions
    0

    Default Re: Help Please - need help with .htaccess file

    mc12345678

    Okay so this is how I changed the file, does this look right? It's still getting a 500 error. I just want to make sure the code is right before I start bugging the server admin. Thanks for the help you ROCK

    <IfModule mod_deflate.c>
    SetOutputFilter DEFLATE
    <IfModule mod_setenvif.c>
    # Netscape 4.x has some problems...
    BrowserMatch ^Mozilla/4 gzip-only-text/html

    # Netscape 4.06-4.08 have some more problems
    BrowserMatch ^Mozilla/4\.0[678] no-gzip

    # MSIE masquerades as Netscape, but it is fine
    # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

    # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
    # the above regex won't work. You can use the following
    # workaround to get the desired effect:
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

    # Don't compress images
    SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
    </IfModule>

    <IfModule mod_headers.c>
    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary
    </IfModule>
    </IfModule>



    <IfModule mod_rewrite.c>

    # Options +FollowSymLinks
    RewriteEngine on

    # RewriteRule ^index\.php$ - [L]

    # Handles the new URL formats
    RewriteRule ^(.*)-c-([0-9_]+)/(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$4&cPath=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$4&cPath=$2&%{QUERY_STRING } [L]

    # Original (unchanged) URL formats
    RewriteRule ^(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-m-([0-9]+)(.*)$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-ezp-([0-9]+)(.*)$ index\.php?main_page=page&id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-c-([0-9_]+)(.*)$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]

    # Rewrite all other requests (if the file / directory does not exist)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index\.php?main_page=$1&%{QUERY_STRING} [L]

    </IfModule>


    Quote Originally Posted by mc12345678 View Post
    Note the following:
    Code:
    ###############################################################################
    # Redirect if request was for index.php (with or without query)
    ###############################################################################
    # Notes:
    #
    # This is a performance optimization. If the request is for index.php simply
    # pass the request on and do not process any other mod_rewrite directives in
    # this file.
    #
    # Basically this avoids the overhead of checking if index.php is a real file
    # or directory (used in subsequent mod_rewrite rules) before sending the
    # request to index.php.
    ###############################################################################
    RewriteRule ^index\.php$ - [L]
    It performs an action on index.php whether there is something that follows it or not... Then stops processing all the rules below it... Then the rules below it (stopped by this one) are all about USU and include index.php.

    I would suggest commenting out that rewriteruleby adding a hash (#) followed by a space...

    But then, lhungil has also provided some input on the issue that may be more directly applicable.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 I need help with my product listing please help im going insane!!
    By Darion in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 10 Sep 2012, 04:16 AM
  2. v150 I need help with my product listing please help im going insane!!
    By Darion in forum General Questions
    Replies: 1
    Last Post: 10 Sep 2012, 02:12 AM
  3. I need help with .htaccess redirect!
    By htmt in forum Basic Configuration
    Replies: 0
    Last Post: 26 Apr 2011, 02:53 PM
  4. Need help with color scheme - URGENT PLEASE HELP
    By nepton in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 18 Nov 2008, 03:48 AM
  5. I need help with adding a button please help me
    By goheadtry in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 6 Jun 2007, 05:23 AM

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