You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Brent Clark <br...@gmail.com> on 2009/05/08 11:31:10 UTC
[users@httpd] Re: Mod rewrite help
Brent Clark wrote:
> Hiya
>
> I need help with a rewrite rule, and I was hoping someone would be
> kind to help.
>
> I need to mod_rewrite and /or alias for the following example links.
>
> http://192.168.111.124/dms-bookings-10000/34873/ACC_1_Comm01_34873_20080303.pdf
>
> http://192.168.111.124/dms-bookings-20000/34873/ACC_2_Comm02_34873_20080302.pdf
>
>
> But the location of the pdfs file is in
> /bookingsdata/bookings_data/bookings
>
Hiya
Sorry to give and example, I have inherited this machine, and I have
this in the conf file
Alias "/dms-bookings/" "/bookingsdata/bookings_data/bookings/"
Alias "/dms-bookings-new/" "/bookingsdata/bookings_data/bookings/"
Alias "/dms-bookings_10000/"
"/bookingsdata/bookings_data/bookings_10000/"
Alias "/dms-bookings_20000/"
"/bookingsdata/bookings_data/bookings_20000/"
snippet
Alias "/dms-bookings_100000/"
"/bookingsdata/bookings_data/bookings_100000/"
I basically want to clean and neaten it up, and I was hoping mod_rewrite
was the answer.
TIA
Brent Clark
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: Mod rewrite help
Posted by Jonathan Zuckerman <j....@gmail.com>.
On Fri, May 8, 2009 at 8:37 AM, Justin Pasher
<ju...@newmediagateway.com> wrote:
> Brent Clark wrote:
>>
>> Hiya
>>
>> Sorry to give and example, I have inherited this machine, and I have this
>> in the conf file
>>
>> Alias "/dms-bookings/" "/bookingsdata/bookings_data/bookings/"
>> Alias "/dms-bookings-new/" "/bookingsdata/bookings_data/bookings/"
>> Alias "/dms-bookings_10000/"
>> "/bookingsdata/bookings_data/bookings_10000/"
>> Alias "/dms-bookings_20000/"
>> "/bookingsdata/bookings_data/bookings_20000/"
>>
>> snippet
>>
>> Alias "/dms-bookings_100000/"
>> "/bookingsdata/bookings_data/bookings_100000/"
>
> Something like this should get you there (untested).
>
> RewriteRule ^/dms-bookings_([0-9]+)/(.*)
> /bookingsdata/bookings_data/bookings_$1/$2
>
> You'll have to leave the first two Alias definitions in there, since their
> format is different.
>
> --
> Justin Pasher
have you considered using symlinks to solve this problem?
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: Mod rewrite help
Posted by Justin Pasher <ju...@newmediagateway.com>.
Brent Clark wrote:
> Hiya
>
> Sorry to give and example, I have inherited this machine, and I have
> this in the conf file
>
> Alias "/dms-bookings/"
> "/bookingsdata/bookings_data/bookings/"
> Alias "/dms-bookings-new/"
> "/bookingsdata/bookings_data/bookings/"
> Alias "/dms-bookings_10000/"
> "/bookingsdata/bookings_data/bookings_10000/"
> Alias "/dms-bookings_20000/"
> "/bookingsdata/bookings_data/bookings_20000/"
>
> snippet
>
> Alias "/dms-bookings_100000/"
> "/bookingsdata/bookings_data/bookings_100000/"
Something like this should get you there (untested).
RewriteRule ^/dms-bookings_([0-9]+)/(.*)
/bookingsdata/bookings_data/bookings_$1/$2
You'll have to leave the first two Alias definitions in there, since
their format is different.
--
Justin Pasher
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org