homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

.htaccess mod rewrite question

 12:13 pm on Oct 26, 2001 (gmt 0)

I currently have the following line in my .htaccess file

RewriteRule ^(.*)\.html$ mycgi?parm=$1 [T=application/x-httpd-cgi]

This strips the ".html" from the file name and passes the remainder as a parameter to my cgi.

The format of the file name is a 5 digit numeric.

Is it possible using .htaccess to just pass the 1st 4 digits as the parameter to the cgi.

eg. 12345.html calls mycgi with parm=1234



 12:20 pm on Oct 26, 2001 (gmt 0)

Typical you go to the trouble of composing a question and then the answer just comes to you:

For info:

RewriteRule ^(.*)[0-9]\.html$ mycgi?parm=$1 [T=application/x-httpd-cgi]

has the desired effect.

Great way to boost your post count ask a dumb question and answer it yourself ;)

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved