#1
  1. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jun 2003
    Posts
    11
    Rep Power
    0

    How to Make a Rewrite Redirect to cgi Script


    I have played with may variations of this but nothing seems to work.

    I want uers to click on a link like
    http:www.domain.com/high-temp.htm

    and receive results gathered by a cgi script.

    I would rather they not see the script name nor the paramaters being used. I just want them to see the address
    http:www.domain.com/high-temp.htm

    I believe I should use the .htaccess file.

    I have tried a rewrite rule but the cgi script shows up in the address.

    I'm currently experimenting with things like

    RewriteEngine on
    RewriteCond %{SCRIPT_NAME} htm$
    RewriteRule /?(.*).htm$ /cgi-bin/fulfill.cgi?request=$1

    but am having no success getting this to work.

    Any suggestions would be helpful.
  2. #2
  3. Contributing User

    Join Date
    Jul 2003
    Location
    Portland, OR
    Posts
    120
    Rep Power
    16
    Use PHP
  4. #3
  5. Head Honcho
    SEO Chat Adventurer (500 - 999 posts)

    Join Date
    Jul 2003
    Location
    Chicago, IL
    Posts
    556
    Rep Power
    16
    i agree
  6. #4
  7. Head Honcho
    SEO Chat Adventurer (500 - 999 posts)

    Join Date
    Jul 2003
    Location
    Chicago, IL
    Posts
    556
    Rep Power
    16
    actually to clarify, use htaccess to push the variables into a php script, and then use php to call the cgi
  8. #5
  9. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jun 2003
    Posts
    11
    Rep Power
    0
    What's the advantage of PHP?

    It only seems like overhead to call a PHP script that then calls a CGI script.

    Perhaps a single PHP script could work.

    Do search engines see PHP page delivery any differently than delivery through a Perl CGI script?
  10. #6
  11. Head Honcho
    SEO Chat Adventurer (500 - 999 posts)

    Join Date
    Jul 2003
    Location
    Chicago, IL
    Posts
    556
    Rep Power
    16
    ok you can do that too, I just assumed you already had something written in CGI and you needed a way to make the connection. If it is not written yet, I would do the whole thing in php with a simple htaccess. However I am a php programmer, so my opinion is biased.

    I think that with a little work on the .htaccess file, though, you can get rid of the /cgi-bin/ in the URL and still use CGI. Never tried it though...

    Try making a script that says "hello" in CGI, and call it from http://www.domain.com/test.html using .htaccess only. If you can get that working then you are way ahead of the game.

Similar Threads

  1. External Links & PHP Redirect Script: Is this OK?
    By chakotha in forum Google Optimization
    Replies: 5
    Last Post: Dec 4th, 2012, 04:33 AM
  2. A script to get top google?
    By Sincerely in forum Google Optimization
    Replies: 4
    Last Post: Oct 26th, 2003, 09:14 AM
  3. google safe redirect script
    By jckm2000 in forum Web Design, Coding and Programming
    Replies: 2
    Last Post: Jul 11th, 2003, 09:54 PM
  4. JS force-frame script ... considered redirect?
    By danbroughton in forum Google Optimization
    Replies: 0
    Last Post: Jun 25th, 2003, 11:16 AM
  5. The correct redirect
    By bbratu in forum Google Optimization
    Replies: 4
    Last Post: Jun 5th, 2003, 10:05 PM

IMN logo majestic logo threadwatch logo seochat tools logo