Hi,
First make the proper redirections:
RewriteEngine on
RewriteMap lsv2ids "txt:/etc/httpd/conf.d/linuxsecurity-lsv2ids.map"
RewriteRule "/content/view/(.*)" "${lsv2ids:$1}" [R,L]
Define the fallback for requests not ending in PHP but for which I
hand the php handler to deal them.
FallbackResource /index.php
Define the handler for php file requests
<FilesMatch \.php>
SetHandler
"proxy:unix:/run/php-fpm/linuxsecurity.sock|fcgi://localhost"
</Filesmatch>
Can I ask about this again? I've got this all set up with a static
map, but request for /content/view/NNNNN where NNNNN is some key that
is not mapped to a value results in a 400 error.
Without this rewritemap/rewriterule, the request falls through to
Joomla where a redirection.php script is called that maps the key to
the corresponding value in a database.
With the rewritemap/rewriterule, it appears it doesn't fall through to
the redirection.php script when there is no match.
Maybe I'm missing the role of the FallbackResource here? However, it
doesn't appear it takes an argument - only an environment variable, so
not sure how that would apply.
Ideas greatly appreciated.
If I could add to this, another idea I had was to run the
redirection.php script directly from apache rather than in Joomla as a
rewriterule. Something like this:
RewriteRule ^/content/view/([0-9]+)/?
/redirection/index.php?type=view&ids=$1&uri=/content/view/$1 [L,R=301]
However, it's the same rewrite pattern as the above rewriterule, so not
sure how that would work.
I should also mention the reason why I need both the static map and the
redirection.php script is that I can't predict every conceivable pattern
that could exist in a map. I was also thinking of putting the top 5000
key/value in the map to be really quick, then let the redirection.php
script process the remaining legacy 70,000 or so...
--
Profile Photo
Dave Wreski
Chief Executive Officer
Guardian Digital Logo <https://www.guardiandigital.com>
*We Make Email Safe For Business*
Guardian Digital Facebook <https://www.facebook.com/gdlinux> Guardian
Digital Twitter <https://twitter.com/gdlinux> Guardian Digital Linkedin
<https://www.linkedin.com/company/guardiandigital>
Phone Icon <tel:+16408009446>
(640)-800-9446 <tel:+16408009446>
Email Security
Web Icon <https://www.guardiandigital.com>
www.guardiandigital.com <https://www.guardiandigital.com>
Sender Fraud Protection
Email Icon <mailto:dwre...@guardiandigital.com>
dwre...@guardiandigital.com
Training & Awareness
Location Icon <https://maps.app.goo.gl/aLZyUyCJznWoW1Jh8>
103 Godwin Ave, Suite 314, Midland Park, NJ 07432
<https://maps.app.goo.gl/aLZyUyCJznWoW1Jh8>