Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: RewriteRule modification |
|
Author |
|
jjree
Joined: 10 Sep 2014 Posts: 1
|
Posted: Wed 10 Sep '14 11:21 Post subject: RewriteRule modification |
|
|
I have these two RewriteRule lines in my htaccess, what they do is rename my photo files.
What the current code shows: MyUsername-mypicture.jpg
What I need to modify it to: mypicture.jpg
Code: | RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)\-(.*?)_([0-9]*?)\.(.*)$ file/pic/photo/$1/$2/$3_$5.$6
RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)\-(.*?)\.(.*)$ file/pic/photo/$1/$2/$3.$5 |
I'm only learning, but I can tell that I just remove this portion: Code: | ([A-Za-z0-9]{32}+)\- |
But what about the $3, $5, $6? How do they work - I can't figure out. It's a simple modification but I'm too new to get it to work.
Please help? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Sat 17 Jan '15 23:45 Post subject: |
|
|
The $ and the numbers are just a counting for the different regexes in the rewrite rule. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
|
Back to top |
|
|
|
|
|
|