Results 1 to 6 of 6
  1. #1
    Newbie
    Join Date
    June 3rd, 2005
    Posts
    12
    mod_rewrite for AE & rockler
    I am trying to keep my current indexed links in rockler. It was installed at the root directory with mod_rewrite. But I want to have AE installed on the root directory as well. I know next to nothing about the mod_rewrite process. How would I combine these two separate .htaccess files into one?

    Thanks!

  2. #2
    ABW Ambassador cusimano's Avatar
    Join Date
    January 18th, 2005
    Location
    Toronto, Canada
    Posts
    1,369
    Rockler .htaccess:

    Options +FollowSymLinks

    RewriteEngine on
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.+$ - [L]

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


    Associate Engine .htaccess:

    RewriteEngine on
    RewriteBase /
    RewriteRule ^(amazon)$ $1/ [R,L]
    RewriteRule ^(amazon)/(.*)(\.[a-z]+)$ cgi-bin/ae.pl?virtual=$2&virtual.dir=$1 [L]
    RewriteRule ^(amazon)/(.*)$ cgi-bin/ae.pl?virtual=$2&virtual.dir=$1 [L]


    Note: Those are 3 RewriteRule lines in a row. They might wrap on your screen. Each starts at RewriteRule and goes until ] at the end of the line.

    Since the Rockler RewriteRule matches everything --- that's the ^(.*)$ pattern --- you must put the Associate Engine RewriteRule before it.

    Merged:

    Options +FollowSymLinks

    RewriteEngine on
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.+$ - [L]

    RewriteRule ^(amazon)$ $1/ [R,L]
    RewriteRule ^(amazon)/(.*)(\.[a-z]+)$ cgi-bin/ae.pl?virtual=$2&virtual.dir=$1 [L]
    RewriteRule ^(amazon)/(.*)$ cgi-bin/ae.pl?virtual=$2&virtual.dir=$1 [L]

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


    Note: Same note as above about long lines split on screen.

    Note: To put amazon results in a different directory, change "amazon" in the RewriteRule's.

    Thus /amazon/* will show ae.pl results and everything else will show Rockler results. If you want to link to /amazon/ from the Rockler pages, then edit the Rockler templates (cgi-bin/dyse/rockler/templates/*.html) and add links to /amazon/

    Yours truly,
    Cusimano.Com Corporation
    per: David Cusimano

  3. #3
    Newbie
    Join Date
    June 3rd, 2005
    Posts
    12
    David,
    That works! It shows the rockler page on the homepage and I tried to place

    DirectoryIndex store.htm

    at the top of the .htaccess file because I want it to display the page I designed incorporating the AE scripts. It isn't working. Is it possible?

  4. #4
    ABW Ambassador cusimano's Avatar
    Join Date
    January 18th, 2005
    Location
    Toronto, Canada
    Posts
    1,369
    Since you have Rockler based at the root directory, the home page (yourdomain.com/) is the generated by DySE::Rockler. If you want to show some AE results or link to AE on that page, edit cgi-bin/dyse/rockler/template/home.html

    If you're talking about what is displayed at yourdomain.com/amazon/ then edit ae.ini and set the default search:

    search.default "template=stores"

    Yours truly,
    Cusimano.Com Corporation
    per: David Cusimano

  5. #5
    Newbie
    Join Date
    June 3rd, 2005
    Posts
    12
    Is it possible to change the rockler templates to .php files instead of .html?

  6. #6
    ABW Ambassador cusimano's Avatar
    Join Date
    January 18th, 2005
    Location
    Toronto, Canada
    Posts
    1,369
    No, it is not possible to directly use PHP in DySE templates. When you access any DySE page, view.pl (a perl script) runs via mod_rewrite. The web server takes the output of view.pl and sends it to the user. The server does not do any further processing of the output from .pl files, so it is not possible to mix PHP and .pl -- that's a server limitation, not a DySE limitation.

    But you can include the output of PHP scripts in DySE templates via a server-side-include (SSI) statement. For example, in the items.html template, you could use the following SSI and pass the item's name as a parameter (e.g.: k):

    <!--#include src="/myscript.php?k={item.name+}"-->

    Yours truly,
    Cusimano.Com Corporation
    per: David Cusimano

  7. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Mod_rewrite help needed
    By zimmy in forum Programming / Datafeeds / Tools
    Replies: 4
    Last Post: April 13th, 2007, 10:53 AM
  2. Mod_Rewrite Question
    By MrSpeed in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: February 25th, 2004, 07:51 PM
  3. UK Host with Mod_Rewrite?
    By Basil-Brush in forum Domains & Hosting
    Replies: 0
    Last Post: August 20th, 2003, 05:16 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
  •