View previous topic :: View next topic |
Author |
Message |
wifiED n00b
Joined: 31 Mar 2008 Posts: 13 Location: South Africa
|
Posted: Tue Apr 21, 2009 1:40 pm Post subject: mod_rewrite apache |
|
|
Hey Guys
Wonder if anyone will be able to assist me.
I am wanting to strip the tailing characters from a file name (file.pdf?abcdefhekjkjhsdhsd) so that apache just serves the plain file name (file.pdf)
Can anyone help with a quick way to do it using mod_rewrite in apache?
Any help would be appreciated
Thanks |
|
Back to top |
|
|
elgato319 Guru
Joined: 15 Sep 2005 Posts: 546
|
Posted: Wed Apr 22, 2009 6:58 am Post subject: |
|
|
mod_rewrite is not responsible for this.
The appliction that generates the urls needs to be altered. |
|
Back to top |
|
|
wifiED n00b
Joined: 31 Mar 2008 Posts: 13 Location: South Africa
|
Posted: Thu Apr 23, 2009 9:25 am Post subject: |
|
|
Hi there
Thanks but yes i am aware of that. But the reason for this is that the application generates a unique tail on the file so that it no.1 doesnt get cached and no.2 is able to keep track of the unique downloads.
|
|
Back to top |
|
|
scherz0 Apprentice
Joined: 02 Oct 2008 Posts: 154
|
Posted: Thu Apr 23, 2009 1:04 pm Post subject: Re: mod_rewrite apache |
|
|
wifiED wrote: | I am wanting to strip the tailing characters from a file name (file.pdf?abcdefhekjkjhsdhsd) so that apache just serves the plain file name (file.pdf)
|
You should not have to use mod_rewrite, since by default the mapping is : URL to filename (i.e. without the query string). Do you confirm that in the error log, apache complains about the file "file.pdf?abcdefhekjkjhsdhsd" missing ? |
|
Back to top |
|
|
cach0rr0 Bodhisattva
Joined: 13 Nov 2008 Posts: 4123 Location: Houston, Republic of Texas
|
Posted: Thu Apr 23, 2009 6:54 pm Post subject: |
|
|
i can help with the regex, cant say whether or not this is an appropriate solution
at least in perl or whatnot it'd be something like
note that regex will break if you have multiple question marks in the Request-URI
this one does not, but isn't as precise
hope that helps? |
|
Back to top |
|
|
|