Results 1 to 7 of 7
  1. #1
    Newbie
    Join Date
    April 22nd, 2005
    Posts
    31
    RewriteRule
    I am using Genericgifts and using:
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ cgi-bin/dyse/view.pl?merch=merchant&dir=&path=$1 [L

    However I also have gocollect installed and am using /httpdocs/gocollect
    as the dir with all the html files

    If I access /httpdocs/gocollect/index.html it will find the gocollect main page, but when I click on a link it takes me back to the root "/httpdocs/index.shtml instead of the next gocollect page /gocollect/*.* (any file or directory).
    Anyone know how I can fix this, do I need to make genericgifts use "dir" RewriteRule or is thier a line I can add to htaccess so that RewriteRule works for both genericgifts and gocollect?

    FYI - /httpdocs/index.shtml is using a #include virtual as the main page.

    Thanks in advance for your help

    Mike

  2. #2
    ABW Ambassador cusimano's Avatar
    Join Date
    January 18th, 2005
    Location
    Toronto, Canada
    Posts
    1,369
    The line
    RewriteCond %{REQUEST_FILENAME} !-f
    is a conditional check to see if the requested file does *not* exist (!-f). If the condition is true (the file does not exist) then the RewriteRule is run. Otherwise processing continues with the rest of the .htaccess file; and if processing reaches the end of the file without any matches, then the originally requested file is accessed (or 404 error if there is no such file).

    So, run FTP or ssh and see if the requested files (/gocollect/*) are really there on the hard disk.

    Try using the following RewriteCond's instead of just the one:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    (followed by the RewriteRule here)

    Otherwise, add the following before all the DySE related lines (but after the line RewriteBase /):

    RewriteRule ^gocollect.* - [L]

    This rule will cause any URL that starts with "gocollect" to be left as is.

    If none of that works, are you using any other rewrite's ? Are you using htmlgz.pl ?

    Yours truly,
    Cusimano.Com Corporation
    per: David Cusimano

  3. #3
    Newbie
    Join Date
    April 22nd, 2005
    Posts
    31
    I got it working using all of them
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ cgi-bin/dyse/view.pl?merch=genericgifts&dir=&path=$1 [L]
    RewriteRule ^gocollect.* - [L]

    if I use just
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ cgi-bin/dyse/view.pl?merch=genericgifts&dir=&path=$1 [L]

    The original happens

    if I use:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ cgi-bin/dyse/view.pl?merch=genericgifts&dir=&path=$1 [L]

    Then my ssi <!--#include virtual="/cgi-bin/dyse/view.pl?merch=genericgifts&dir=&path=$1" --> no longer works and gives internal script error

    If I use:
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ cgi-bin/dyse/view.pl?merch=genericgifts&dir=&path=$1 [L]
    RewriteRule ^gocollect.* - [L]

    Just genericgift works ^

    so in summary this worked:
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ cgi-bin/dyse/view.pl?merch=genericgifts&dir=&path=$1 [L]
    RewriteRule ^gocollect.* - [L]

    BTW no I an not using htmlgz.pl

    Thanks David for the help

  4. #4
    ABW Ambassador cusimano's Avatar
    Join Date
    January 18th, 2005
    Location
    Toronto, Canada
    Posts
    1,369
    I'd like to know what happens when you try this:

    RewriteEngine on
    RewriteBase /
    RewriteRule ^gocollect.* - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ cgi-bin/dyse/view.pl?merch=genericgifts&dir=&path=$1 [L]

    The gocollect check (or any other real directories you want to check for) must go first since ^(.*)$ matches everything and therefore should go last in the .htaccess file.

    Where are you using that SSI? Why use SSI to call view.pl?

    (reference: Brief Introduction to .htaccess File)

    Yours truly,
    Cusimano.Com Corporation
    per: David Cusimano

  5. #5
    Newbie
    Join Date
    April 22nd, 2005
    Posts
    31
    Hi David,

    Your code above worked fine.

    SSI was being used in my root (index.shtml) and I just relized I do not need it due to htacess's rewrite ....dah!

    Thanks again

    Mike

  6. #6
    Newbie
    Join Date
    May 7th, 2005
    Location
    Florida
    Posts
    11
    Mike, we had spoke once before - you are in Tampa, I am over in Polk County. David spent a tremendous amount of time trying to get DYSE scripts to work (two different servers) and discovered problems at both that I never would have known about. - I am indebted to him. Have you got DYSE to work on your servers? If so let me known whom so maybe I can change my hosting. thanks

  7. #7
    Newbie
    Join Date
    April 22nd, 2005
    Posts
    31
    email me mmcbee1 "at" tampabay.rr.com

  8. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Any .htaccess rewriterule Gurus around?
    By Uncle Rico in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: August 24th, 2008, 08:20 AM
  2. RewriteRule htaccess Help
    By Uncle Rico in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: September 7th, 2007, 03:38 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
  •