Re: Vanity URL Rewrites Best Practices?

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

 



> For example,
> 
> http://foo.com/mmh/maintenance_plan/tip?contentCategoryType=MaintenanceTip&id=%2Fwww%2Favm_webapps%2Fmmh%2Fmaintenance-tips%2Fcontent%2Fafter_blizzard.xml
> 
> Being sent to
> 
>  http://foo.com/mmh/articles/authored/after-blizzard
> 
> We've got a very frequent process where we'll get a huge block of rewrites
> like this that vary just by the last part and so far just keep going through
> and adding dozens and dozens of new rewrite rules each time.  Surely there
> has to be a better way?  (Ideally that just involve Apache changes and not
> code changes on the back-end)

Are the requests similar enough that you can write a single regular expression,
or maybe two or three, that extracts the useful part from the URL in every case?
For example,

RewriteCond %{REQUEST_URI} ^/mmh/
RewriteCond %{QUERY_STRING} \%2F(\w+)\.xml$
RewriteRule .* /mmh/articles/authored/%1

If you can describe all of the requests in this way or something like it, you're
done.  If not, if each request is so different that it needs its own regular
expression, then it seems you're doomed to keep doing it as you are now.

Good luck,
Andrew.


---------------------------------------------------------------------
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