?
Solved

mod_rewrite image names

Posted on 2007-10-04
3
Medium Priority
?
285 Views
Last Modified: 2012-06-22
Hi,

is there a way to use mod_rewrite to change the name of my images.

for example i have <img src="/my_image_folder/imagename.gif">

but i would like <img src="/my_image_folder/anything_i_like_here_(img)_imagename.gif">

but it would still bring up the same image as above. (I put (img) in a seperator)

is there a way?

cheers

Stu
0
Comment
Question by:stuayre
  • 2
3 Comments
 
LVL 43

Expert Comment

by:ravenpl
ID: 20015352
Of course
Put .htaccess file into my_image_folder/ (! ! !)

RewriteEngine On
RewriteCond %{REQUEST_URI} !anything_you_like
RewriteRule (.+) anything_you_like_$1 [L]

It will rewrite any image access to anything You like, except the image have alread anytning You like in its name
0
 
LVL 1

Accepted Solution

by:
stuayre earned 0 total points
ID: 20137708
Hi

I tried it with

<img src="/img_test/anything_i_like_here_(img)_jeep_2000.JPG">

and

RewriteEngine On
RewriteCond %{REQUEST_URI} !anything_you_like
RewriteRule (.+) anything_you_like_$1 [L]

in my img_test/ folder with jeep_2000.jpg but it doesnt work.


0
 
LVL 1

Author Closing Comment

by:stuayre
ID: 37877300
no answer
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month17 days, 4 hours left to enroll

862 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