in reply to Re: Grabbing numbers from a URL
in thread Grabbing numbers from a URL
Here's what I'm doing. I'm using this recipe in the .htaccess file to run a perl script to display a page, but it displays a .html file in the browser.$url=q|$itemID|; $url=~/(\d{4})+\.htm/i;
So in the script getpage.pl, I grab the $itemID with the code above and turn it into a filename. I search the database for a filename field that includes the page. Sometimes it's 1234.html, other times it's something-something-1234.html. It would really be best to simply grab the 1234 but I don't know how to do that.RewriteEngine on RewriteRule ^(.*)$ $1 [nc] RewriteRule ^(.*)$ /cgi-bin/getpage.pl?itemID=$1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Grabbing numbers from a URL
by kevbot (Vicar) on Jul 09, 2017 at 06:45 UTC |