?
Solved

Mod-rewrite question: convert static URL to dynamic for dynamic signatures

Posted on 2006-05-29
6
Medium Priority
?
174 Views
Last Modified: 2010-03-04
Hey there, I want to create a mod_rewrite rule to allow dynamic signatures.

Here is the client URI: http://www.somesite.com/pilot1.png
Here is the rewritten URI: http://www.somesite.com/sigs/sig.php?id=pilot1.png

Also please include which .htaccess file(s) needs modifying.

Thanks.
0
Comment
Question by:Dodger42
  • 3
  • 3
6 Comments
 

Author Comment

by:Dodger42
ID: 16788386
No response so points bumped up.
0
 
LVL 4

Expert Comment

by:Tol_cv
ID: 16789986


if you want it for png extension only, you can try something like :


RewriteRule ^(.*)\.png$  http://www.somesite.com/sigs/sig.php?id=$1\.png
more info on  url rewriting:
http://rosebud.stanford.edu/manual/misc/rewriteguide.html
0
 

Author Comment

by:Dodger42
ID: 16795374
Ok that redirect is kind of working, but there is an extra slash in there after the = sign:

http://192.168.0.250/sigs/sig.php?id=/42SF-Dodger

"/42SF-Dodger" should be "42SF-Dodger"
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 4

Accepted Solution

by:
Tol_cv earned 1600 total points
ID: 16796289

to eliminate the slash:

RewriteRule ^/(.*)\.png$  http://www.somesite.com/sigs/sig.php?id=$1\.png
0
 

Author Comment

by:Dodger42
ID: 16797393
One more thing. If I only want this rule to take place if the request is in the / directory, do I just put that rule int he directory section for /?

Thanks
0
 
LVL 4

Expert Comment

by:Tol_cv
ID: 16798066
you can use:

RewriteRule ^/(.+[^/])\.png$  http://www.somesite.com/sigs/sig.php?id=$1\.png
(.+[^/])  where  matches everything , exept string that contains /

it doesn't help to use  RewriteRulele  ^/(.*)\.png$  http://www.somesite.com/sigs/sig.php?id=$1\.png   in <directory> section.   A rule is used in non-server context  if you add it to  a .htaccess file.

0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month16 days, 15 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question