simple directory rewriting question
am 14.06.2007 22:55:04 von laredotornado
Hi, I'm using Apache 2 on Linux. I have mod_rewrite in the
installation. How would I rewrite URLs of the form
/maindir/old_dir/subdir1/subdir2/file
to
/maindir/new_dir/subdir1/subdir2/file
What I'm basically asking is how do I have all URLs with "/old_dir"
translated to "/new_dir" before the paths are resolved?
Thanks, - Dave
Re: simple directory rewriting question
am 15.06.2007 02:06:19 von shimmyshack
On Jun 14, 9:55 pm, "laredotorn...@zipmail.com"
wrote:
> Hi, I'm using Apache 2 on Linux. I have mod_rewrite in the
> installation. How would I rewrite URLs of the form
>
> /maindir/old_dir/subdir1/subdir2/file
>
> to
>
> /maindir/new_dir/subdir1/subdir2/file
>
> What I'm basically asking is how do I have all URLs with "/old_dir"
> translated to "/new_dir" before the paths are resolved?
>
> Thanks, - Dave
rewrites rewrite urls, you need an alias
Alias /maindir/old_dir/ /maindir/new_dir/
Re: simple directory rewriting question
am 15.06.2007 02:08:56 von shimmyshack
On Jun 15, 1:06 am, shimmyshack wrote:
> On Jun 14, 9:55 pm, "laredotorn...@zipmail.com"
>
> wrote:
> > Hi, I'm using Apache 2 on Linux. I have mod_rewrite in the
> > installation. How would I rewrite URLs of the form
>
> > /maindir/old_dir/subdir1/subdir2/file
>
> > to
>
> > /maindir/new_dir/subdir1/subdir2/file
>
> > What I'm basically asking is how do I have all URLs with "/old_dir"
> > translated to "/new_dir" before the paths are resolved?
>
> > Thanks, - Dave
>
> rewrites rewrite urls, you need an alias
> Alias /maindir/old_dir/ /maindir/new_dir/
ignore that - sorry that was a load of rubbish!
you need a symlink and to add FollwSymLinks to your options.
of course if you are actually talking about
http://server.com/maindir/old_dir/subdir1/subdir2/file
then you _can_ use rewrites
also you _could_ just move the stuff