Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 5 of 5

This is a discussion on Can't get .htaccess to work in the Shared & Semi-Dedicated forum
I have an OSCommerce shop I am trying to install a chage to. The code is used by many users and I just installed it ...

  1. #1
    JPC Senior Member
    Join Date
    Jul 2004
    Posts
    79

    Can't get .htaccess to work

    I have an OSCommerce shop I am trying to install a chage to. The code is used by many users and I just installed it for someone else on a different host. It works as expected except for on Jaguar.

    In my shop, a typical url for a product is
    http://excelsior.nocdirect.com/~ptca...products_id=22
    The .htaccess entry is supposed to redirect from
    http://excelsior.nocdirect.com/~ptca...roduct_22.html
    to the above link.

    The line in the .htaccess file is
    RewriteRule ^product_([1-9][0-9]*)\.html$ product_info.php?&products_id=$1 [L]

    For this to work, mod_rewrite has to be on and the httpd.conf file needs AllowOverride All set. Jag assures me both of these are set. But when I try the above link it doesn't work. Jag has been working in it for days to no avail. Does anyone here have any idea why this won't work on Jag servers?

    Jack

  2. #2
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    1) Ensure the proper permissions for .htaccess. (644)
    2) The line
    Code:
    RewriteEngine On
    should be above the line you want executed
    3a) I wonder about the base directory... have you tried it with a direct URL rather than the theserver.nocdirect.com/~domain construct?
    3b) Did you try using a RewriteBase command to set the base directory?

    What results are you getting, if any? (Look in your error log to see exactly what pages, if any, are being requested)

    Good luck!

    Another thought: Is there another rewrite line above it that ends with an "L" rule?
    Last edited by Ron; 11-12-2004 at 08:23 AM.

  3. #3
    JPC Senior Member
    Join Date
    Jul 2004
    Posts
    79
    3a - This site was set up to test this code in case there was a problem. But I went ahead and installed it on a site with a registered URL and it worked. So apparently it can't resolve the name (maybe the ~)? In any event, it is resolved, sort of. It would be nice to be able to run test code on a test site. I've passed your fix on to Jag so maybe they can figure it out from here. Thank you very much for your help.

    Jack

  4. #4
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    The ^ means "from the begining" in a regular expression. If you were resolving through a normal domain name with the cart at the root level of the site, the path your would be trying to mach against would be /product_... and the code wold match fine. Since you have another directory level in there (the username portion), the url becomes /~username/product_..., so the tes you've specified fails and nothing happens. Try either removing the ^ or adding ~username/ to the before and after URLs.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  5. #5
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Quote Originally Posted by Jack
    ...Jag has been working in it for days to no avail. Does anyone here have any idea why this won't work on Jag servers?

    Jack
    Have you read this? http://forums.oscommerce.com/lofiver...hp/t95197.html
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

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
  •