Hi Kriesi,
I am perfectly aware that this is outside of your scope, but still would super appreciate your help on it ;-)
It seems so simple, but there’s nowhere on the Google I can find this.
I have a plugin, that auto-generates code, when a request comes in.
However, I need to intercept this and ideally have some code execute there to do checks on some tables in the database.
None of the ‘Redirect Plugins’ can get in early enough for it to work.
I believe I have 2 Options, but cannot find the details to implement them, can you help?
[Situation/requirement]
a)if http://www.domain.com/k2m is called, then it should redirect to http://www.domain.com/directory
b) if http://www.domain.com/k2m/listing/listing_one or anything else in any subdirectory is called, then it should not do anything, it should let it through
c) if http://www.domain.com/directory is called then is should run some code to do a check on the logged in user. If the check is ok, then it should continue to that url, if not, it should redirect to another url
[Options]
1) If I can get to run code on some hook before the plugin spits out its autogenerated code, that would be amazing. Then I can cover all scenarios. How do I do that? what is the hook/filter? Sample?
2) if I can get a line in .htaccess to do a redirect, then at least I got a) and b) covered.
Unfortunately this does not seem to be as easy as it seems.
A 301 Redirect in .htaccess will just remap http://www.domain.com/k2m AND everything below that to another URL, so this is not an option.
Can you give me a sample .htaccess line that redirects only one specific request?
I am a developer, but not a web developer, so I do not understand all the specific wordpress url/remapping/get/post/url parameter stuff.
THANKS!!