Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to execute cgi script upon http request on a certain directory

Status
Not open for further replies.

ttest

Programmer
Jun 28, 2000
38
US
my website accepts anyone to signup as member. i want my website to be able to display info on my member by accessing my website as below:<br><br>&nbsp;&nbsp; can't create a static html page for everyone who signup to my site. i wanted to make apache run a script whenever there is a request on ' to capture the membername and return a html page using data from my database.<br><br>how to tweak the conf files to make this work?
 
One way to accomplish this is to edit your 'ErrorDocument 404' directive to point to the perl script you want to use. Since an error is generated whenever someone requests a directory that is not there, you can now redirect the user or build a dynamic page in response. Your CGI script can take the $REQUEST_URI or other http request variables and use it to pull a record from the database to build the user page in question. This method works great with PHP. I have not done this with Perl, however, so I don't have specifics.<br><br>You could also use a server-side include on a .shtml page to call the CGI script.<br><br>A possible drawback to this: I don't know how much processor time is used in 'Error 404' redirects. If your website is expecting a LOT of traffic, you might want to consider using mod_rewrite, which would provide a more elegant way of dealing with what is essentially 'faking' directories on your website.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top