Re: Mod_Rewrite voodoo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05-Jan-10 17:43, Igor Cicimov wrote:
You can try this

RewriteEngine On
RewriteRule (.*)([0-9]{2}).html$ /20$2/$1$2.html [R,L]

I wrote it on the go and haven't tested it. It might be done in different
way probably but give this one a go and will see what can we do if it is not
working.

Okay.

Offhand, I'd guess that this would move every file with two digits
in the two spots immediately to the left of the period, to the
subdirectory that corresponds to 20$2 - which may work out okay.
I'm not sure that this would be wanted or needed for files with the
10 (2010) year code however - the site is moving to a blog format
so this won't be an issue moving forward but, the files from 2005
thru 2009 still need to be cleaned up.

I'm also not sure what would prevent this from becoming endlessly
recursive, since the domain/2005/file013105.html file may still
get processed and redirected to domain/2005/2005/file013105.html,
etc. and etc. Is an [L] flag needed or something?

Reese



---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux