Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

You need mod_rewrite. If you have a stock RH 7.x apache you will have it already. If the fragment presented chokes (because mod_rewrite is not installed) you will need to recompile apache. From memory if you just want mod_rewrite you have to pass these flags to configure:

./configure --enable-module=rewrite --enable-shared=rewrite

As always RTFM. Speaking of which if you want ssl, mod perl and mod_rewrite you will find a good description at http://perl.apache.org/docs/1.0/guide/install.html Note that you don't get the http://www.domain.com bit passed to mod_rewrite just /thedirectory/blah. We implement it like this using a VH container. We had some issues with it outside a VH container, even though the server is a dedicated one (no virtual hosts)

<VirtualHost *> ServerName your.domain.com RewriteEngine on RewriteLog /var/log/httpd/rewrite.log RewriteLogLevel 1 RewriteRule ^/thedirectory(.*)$ http://your.domain.com/cgi-bin/scrip +t.pl?$1 </VirtualHost>

In the rewrite rule we capture the bit after thedirectory in $1 to pass to our script. You can use a full http:// or a partial /cgi-bin rewrite path which will result in the user seeing or not seeing the redirect respectively (also from memory) We use the full path exteernal redirect for reasons that currently elude me ;-)

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


In reply to Re: Perl script to handle requests to a http://.../path/* by tachyon
in thread Perl script to handle requests to a http://.../path/* by xiper

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-03-28 23:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found